home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!utcsri!torn!cunews!revcan!sidus!atronx.OCUnix.On.Ca!qpoint!dej
- From: dej@qpoint.ocunix.on.ca (David Jones)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: fork() for AmigaDOS?
- Distribution: world
- Message-ID: <dej.01dt@qpoint.ocunix.on.ca>
- References: <1992Aug26.010450.18412@galileo.cc.rochester.edu> <paulk.1a06@terapin.com>
- Date: 28 Aug 92 20:38:43 EST
- Organization: Dejital Software
- Lines: 33
-
- In article <paulk.1a06@terapin.com> paulk@terapin.com (Paul Kienitz) writes:
- >> Is there a AmigaDOS fork() that works like UNIX fork()?
-
- Although CreateNewProc() can be used to create a new process, there is
- a fundamental difference in OS design between AmigaOS and Unix which
- can seriously affect the way a Unix programmer designs an Amiga program.
-
- Under Unix, fork() causes an exact copy of the currently executing
- process's memory image to be made. The resulting parent and child
- processes do not share any common memory (unless they deliberately
- set up a shared memory segment). Also, file handles are duplicated
- so that both parent and child have open whatever was open just before
- the fork() call. When setting up pipes, usually parent and child
- close opposite ends of a pipe so that data transfer is unidirectional.
-
- Under AmigaOS, there is no memory protection, so separate core images
- are impossible (for now). Also, no system resources are duplicated,
- so closing a file in one process will cause the other process's file
- to be closed as well. (Not the case in Unix).
-
- An example of this difference in design can be seen in the gnutar
- source code. Under Unix, gnutar forks twice if compressed archiving
- is requested: a reader process, a writer process, and compress.
- Under AmigaOS, gnutar cannot compress. Reason: although AmigaOS can
- spawn child processes, the differences in pipe handling required
- between AmigaOS and Unix would have made the program too difficult
- to port, so compression was not supported on the Amiga.
-
- --
- David Jones, 6730 Tooney Drive, Orleans, Ontario K1C 6R4 CANADA
- email: dej@qpoint.ocunix.on.ca Fido: 1:163/109.8
- AMIGA: Advanced Multimedia with Interactive Graphics and Audio
-
-