what happens if

what happens if

Erez D erez0001 at gmail.com
Wed Mar 21 15:10:36 IST 2012


2012/3/20 Diego Iastrubni <elcuco at kde.org>

> On יום שלישי 20 מרץ 2012 10:45:19 Erez D wrote:
> > > All theory I read before implementing this said this was a bad idea.
> The
> > > theory says that libc may maintain some mutex inside malloc() which is
> > > called
> > > from printf() for example. This means that even trivial things may kill
> > > your
> > > app. The theory says that in multithreaded applications as soon as you
> > > clone()
> > > (the system called used by pthread_create()) you should execvp.
> > >
> > > In my application (a lot of C++, running on linux 2.6.32, glibc 2.9 and
> > > glibc
> > > 2.11.1 on ARM) erverything worked perfectly against the theory, your
> > > mileage
> > > may vary.
> >
> > what do you mean by " erverything worked perfectly against the theory" -
> > did it work or did you have problems although you just execvp after
> clone ?
> Sorry, to be clear:
>
> I cloned(), then forked(), but no exec*() was called in the new child
> process.
>
doesn't clone() and fork()  do similar things ? why fork() after clone() ?

>
> Everything worked fine in my setup. But again, YMMV.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cs.huji.ac.il/pipermail/linux-il/attachments/20120321/6cea42a3/attachment.html>


More information about the Linux-il mailing list