what happens if i am running a multithreaded app ( 3 threads ) and one
thread calls fork() ?
___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
Hi Erez,
On Mon, Mar 19, 2012 at 10:47:20AM +0200, Erez D wrote:
> what happens if i am running a multithreaded app ( 3 threads ) and one
> thread calls fork() ?
See pthread_atfork(3).
baruch
--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}
FTFM:
"The child process is created with a single thread - the one
that called fork()."
2012/3/19 Erez D
> what happens if i am running a multithreaded app ( 3 threads ) and one
> thread calls fork() ?
>
> ___
> Linux-il mailing list
> Linux-il@cs
On Mon, Mar 19, 2012, Erez D wrote about "what happens if":
> what happens if i am running a multithreaded app ( 3 threads ) and one
> thread calls fork() ?
On Linux, the new process will run ONLY a copy of the thread doing the
fork(). The other threads are *not* copied to the child process.
Ther
On Mon, Mar 19, 2012 at 11:40 AM, Nadav Har'El wrote:
> On Mon, Mar 19, 2012, Erez D wrote about "what happens if":
> > what happens if i am running a multithreaded app ( 3 threads ) and one
> > thread calls fork() ?
>
> On Linux, the new process will run ONLY a copy of the thread doing the
> fork
On Mon, Mar 19, 2012, Erez D wrote about "Re: what happens if":
> my reason for fork is only for exec() - to protect the first program from
> the other.
Then you should be all fine.
> the problem that may arise in forking a multithreaded is that one thread
> may lock a mutex and then another call
On Mon, Mar 19, 2012 at 12:20 PM, Nadav Har'El wrote:
> On Mon, Mar 19, 2012, Erez D wrote about "Re: what happens if":
> > my reason for fork is only for exec() - to protect the first program from
> > the other.
>
> Then you should be all fine.
>
> > the problem that may arise in forking a multit
On Mon, Mar 19, 2012, Erez D wrote about "Re: what happens if":
> > If you're talking about the C language, you won't have any of these
> > problems. System calls like close() or dup() do not use any pthread
> > capabilities like mutexes.
>..
> i will be using C++. are you sure this is safe ?
I'm
On Mon, Mar 19, 2012 at 12:25 PM, Nadav Har'El wrote:
> On Mon, Mar 19, 2012, Erez D wrote about "Re: what happens if":
> > > If you're talking about the C language, you won't have any of these
> > > problems. System calls like close() or dup() do not use any pthread
> > > capabilities like mutexe
On יום שני 19 מרץ 2012 12:22:15 Erez D wrote:
> On Mon, Mar 19, 2012 at 12:20 PM, Nadav Har'El
wrote:
> > On Mon, Mar 19, 2012, Erez D wrote about "Re: what happens if":
> > > my reason for fork is only for exec() - to protect the first program
> > > from the other.
> >
> > Then you should be all
10 matches
Mail list logo