Re: Processes and Threads



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

.



Relevant Pages

  • Re: WSJ article on software liability
    ... >about how your system compares with the idea of a thread of execution. ... >My cride understanding of a computer hardware system is that, ... A COSA system has a single thread of execution, ... is a cell. ...
    (comp.programming)
  • Re: WSJ article on software liability
    ... >>about how your system compares with the idea of a thread of execution. ... >>For instance, according to my understanding, a simple combustion engine ... > A COSA system has a single thread of execution, ... is a cell. ...
    (comp.programming)
  • Re: If you got to choose the syntax, what would you do?
    ... We can execute a stream serially by jumping to or calling an incoming ... have a faster mechanism for remote proceedure calls, remote execution ... part of the normal compiler. ... I am willing to make a distinction between tokenized source and ...
    (comp.lang.forth)
  • Re: Following streams
    ... Can you show me this on a map? ... While a stream may dump out into a marsh, ... fork off into tributaries. ... then gouge a deeper path, tipping the balance toward that fork even ...
    (misc.survivalism)
  • Re: On Node Change evente with a Treeview
    ... > single thread of execution), facultative process (when you raise an event, ... > there can be no one to catch it, as for most events under an Access FORM, ... > to itself (remember that VBA has just one thread of execution). ...
    (microsoft.public.access.forms)