[fpc-pascal]fork with forked program

Michael Van Canneyt michael.vancanneyt at wisa.be
Tue Sep 16 14:31:06 CEST 2003

On Tue, 16 Sep 2003, Matt Emson wrote:

> Michael, forgive me if I am wrong - I am not a Unix buff - but I was under
> the impression that forking was a method for creating multithreaded unix
> apps?!? Everytime you fork() you end up with two seperate processes running
> concurrently. You differentiate between them by chacking the result given by
> fork(). Certainly under Cygwin this works. I also have some code written
> using POSIX calls on BeOS that creates a daemon by forking 3 times.

Multithreaded applications share the same memory space.
Forked applications are truly separate applications, they have a different memory

So the term 'multithreaded' doesn't apply. If you want to share the
same memory space, you need the 'Clone' function in linux.


More information about the fpc-pascal mailing list