threads on linux are created via the clone() command. clone() is a
superset of fork() -- infact vfork(), fork() and co. are just wrappers to
clone() on linux.

clone() can take a parameter where the process space is not split
(e.g. the child process shares the parent's process space ENTIRELY,
e.g. BSS and TEXT, not just read-only as in copy-on-write implementations
of fork). so that's who threads are implementted.

there are some drawbacks, e.g. if a signal is sent to a thread, all
threads must receive the same signal. since on linux they are processes,
the other threads do NOT receive the signal. this is a violation of
posix1003.1c.

however linus sez that strict by-the-book compliance with 1003.1c is not
wise, and that the threads-as-processes model is elegant in its own right
so its "ok" to break 1003.1c in this one regard.

i tend to believe him, all unix portable code has work-arounds naman for
brokenness and non-standards compliance. since linux is the numero uno
unix, i dont see how its a disadvantage, everyoen is coding for linux
anyway.

-- 

---------------------------------------------------------------------
Orlando Andico <[EMAIL PROTECTED]>       POTS Phone: +63   (2) 937-2293
Mosaic Communications, Inc.            GSM Mobile: +63 (917) 531-5893
I'm not suffering from insanity -- I'm enjoying  every minute of it!!


_
Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]

Reply via email to