LWN.net Logo

fork

fork

Posted Oct 2, 2012 22:51 UTC (Tue) by the.wrong.christian (guest, #73127)
In reply to: fork by tialaramex
Parent article: An Interview with Brian Kernighan (InformIT)

I'd safely assume that any X11 GUI app that fork'ed then executed GUI calls would suffer from undefined behaviour. Apart from anything else, it'd be sharing an X11 connection with it's parent process, so there would be all sorts of concurrency issues.

I'd wager most libraries are not fork safe, including such libraries as SQLite as mentioned in the SQLite FAQ. Libraries that talk to the outside world contain much state that is not safe to share.

I don't this makes Darwin especially shoddy (this is a Darwin "issue", BTW, rather than an OS X issue.)


(Log in to post comments)

fork

Posted Oct 4, 2012 21:06 UTC (Thu) by ballombe (subscriber, #9523) [Link]

> I'd safely assume that any X11 GUI app that fork'ed then executed GUI calls would suffer from undefined behaviour. Apart from anything else, it'd be sharing an X11 connection with it's parent process, so there would be all sorts of concurrency issues.

Fortunately, you are wrong. The X11 protocol allows the child to open its own display and create its own graphic context without interfering with the parent process.

fork

Posted Oct 5, 2012 4:20 UTC (Fri) by Kit (guest, #55925) [Link]

How many applications out there actually take advantage of that ability? I'm fairly certain that sort of exotic thing isn't ever used by either GTK or Qt. X11 has a lot of flexibility that seems to never actually get used for one reason or another.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds