Re: using pthreads with fork() in linux
- From: "Arnold Hendriks" <a.hendriks@xxxxxxxxxxxxxxxxxx>
- Date: Tue, 30 May 2006 19:57:24 +0200
"Maxim Yegorushkin" <maxim.yegorushkin@xxxxxxxxx> wrote in message
news:1148982325.315534.311840@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Arnold Hendriks wrote:
For one, you should only use async-signal-safe functions after fork(),
until
you exec().
This is wrong. You are probably talking about vfork().
This is why there is pthread_atfork.
http://www.opengroup.org/onlinepubs/009695399/functions/pthread_atfork.html
http://www.opengroup.org/onlinepubs/009695399/functions/fork.html
A process shall be created with a single thread. If a multi-threaded process
calls fork(), the new process shall contain a replica of the calling thread
and its entire address space, possibly including the states of mutexes and
other resources. Consequently, to avoid errors, the child process may only
execute async-signal-safe operations until such time as one of the exec
functions is called.
.
- Follow-Ups:
- Re: using pthreads with fork() in linux
- From: Maxim Yegorushkin
- Re: using pthreads with fork() in linux
- References:
- using pthreads with fork() in linux
- From: Elena
- Re: using pthreads with fork() in linux
- From: Jelte
- Re: using pthreads with fork() in linux
- From: Arnold Hendriks
- Re: using pthreads with fork() in linux
- From: Maxim Yegorushkin
- using pthreads with fork() in linux
- Prev by Date: Re: using pthreads with fork() in linux
- Next by Date: Re: using pthreads with fork() in linux
- Previous by thread: Re: using pthreads with fork() in linux
- Next by thread: Re: using pthreads with fork() in linux
- Index(es):
Relevant Pages
|