yes, linux has processes you can create with fork() or more general with
clone() - it appeared later.
Thread is process again - and on NT (according to the original question)
there's special API to create thread. By the M$oft definition is thread
separate process sharing the same data space with parent process. fork()
gets his own copy, you have to use clone() with the right parameter to
achive this functionality.
NT has no fork() or clone(), M$soft developed API similar to POSIX
threads.
According to POSIX threads: it's a library encapsulating process creation
(process == thread). You don't need to learn process stuff on every OS,
you must get POSIX thread library implementation for your OS. On linux
it uses clone() on NT CreateThread() and so on.
Comparison and summary:
exec(), spawn() - creates process with its own data space and you can
add some params about environment inheritation etc.
* Linux + NT
fork() - creates process with its own data space and the same env. etc.
* Linux, NT not
clone() - creates process with its own data space or not - it depends on
params - and the same env. etc.
* Linux, NT has similar way to do it only with shared data space
via CreateThread()
using of POSIX threads implies:
on Linux calling clone() and process API
on NT calling CreateThread() and the rest of API
Now you can see that linux is more powerful (encapsulates NT features)
Another thing is OS process implementation. Is clone() faster than
CreateThread() ? I don't know and to confuse you and me myself -
there are linux kernel-threads (I only heard it) ;-).
To be more confused - NT has fibers too ... ;-)).
I worked on multi-threaded (or multi-processed if you want) application
for linux and win32 and I tested it on DEC Alpha UNIX too. I used clone()
or CreateThread() API (M$soft gives you no POSIX threads syntax compatible
library, grr.) Then I wrote essential things from POSIX threads from
scratch. At last I found cygwin project - UNIX env. on win32 and POSIX
threads for cygwin - finally the same threaded source.
As I said above, the question is not in process/threads API but
which implementation of process creating/handling is faster ?
> Stephen
>
Ferda Prantl
----------------------------------
Ferdinand Prantl
LVT FF UK
e-mail: prantl@ff.cuni.cz
www: http://www.ff.cuni.cz/~prantl
ICQ: 36302930
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/