Re: [Re: Process creating]

Jan Hudec (bulb@ucw.cz)
Sat, 30 Jun 2001 12:32:47 +0200


On Wed, Jun 27, 2001 at 12:35:13AM -0600, Blesson Paul wrote:
> 1: P1 and P2 have different physical areas of memory. This is how
> protection works.
>
> 2: Why do they need to share the same memory? You can have your second
> process
> communicate with your first process through IPC.
>
> 3: Linux supports threading if you include the thread library, and use the
> appropriate
> threading process calls.
>
> Another thing you can do is have a common space on the hard drive. It's not
> as fast as RAM,
> but it's one solution.

As to 1 (and 3), if you clone the processes (using the __clone - advanced
version of fork), you can specify what the processes should share. Including
memory. Thus you can also have threads (that share everything but stack) even
without a thread library (libpthread actualy does just that, but it has some
conveniece stuff like locks).

As of 2, avoid using ipc, especialy the sysv one - it's rather kind
of crap (IMHO).

-------------------------------------------------------------------------------
Jan 'Bulb' Hudec <bulb@ucw.cz>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/