Re: Processes and Threads
- From: David Schwartz <davids@xxxxxxxxxxxxx>
- Date: Sat, 15 Sep 2007 16:59:46 -0700
On Sep 15, 6:14 am, Jan-Thierry Wegener <wege...@xxxxxxxxxxxxxxxxx>
wrote:
i know that processes can create threads and processes, but my question
is: can threads create other threads or even processes?
If not, how could you *ever* create a thread or a process? If any code
is running, by definition it's a thread.
is this on all *nix systems the same or do they differ?
It's a matter of definition. A thread is just a stream of execution.
You cannot have any code running without a thread.
This might help:
Thread: A stream of execution.
Process: A logical address space, file descriptor table, and other
resources shared by one or more threads.
A thread (that is part of a process) can typically do two things:
1) Call a function like 'pthread_create' that creates an additional
thread in the same process.
2) Call a function like 'fork' that creates a new process that starts
with a single thread.
DS
.
- Follow-Ups:
- Re: Processes and Threads
- From: phil-news-nospam
- Re: Processes and Threads
- From: Jan-Thierry Wegener
- Re: Processes and Threads
- References:
- Processes and Threads
- From: Jan-Thierry Wegener
- Processes and Threads
- Prev by Date: Re: writing drivers using C++
- Next by Date: Re: Processes and Threads
- Previous by thread: Processes and Threads
- Next by thread: Re: Processes and Threads
- Index(es):
Relevant Pages
|