User: Password:
|
|
Subscribe / Log in / New account

fork

fork

Posted Oct 2, 2012 21:00 UTC (Tue) by ballombe (subscriber, #9523)
In reply to: fork by tialaramex
Parent article: An Interview with Brian Kernighan (InformIT)

The Core foundation framework will actively abort if called after a fork().
This is well documented.


(Log in to post comments)

fork

Posted Oct 2, 2012 21:18 UTC (Tue) by tialaramex (subscriber, #21167) [Link]

Needless to say our software (written primarily for Linux, but never deliberately made non-portable) did not use this "Core foundation framework" which judging from its name I'd guess is neither the "core" of the system, nor any sort of "foundation" and possibly not even a framework but instead some layer of crap on the top.

fork

Posted Oct 2, 2012 21:53 UTC (Tue) by ballombe (subscriber, #9523) [Link]

"core foundation" is used by "cocoa" which is the standard GUI library. This is used by e.g. the libfltk "native" port on OS X.
So if you write a portable program that use libfltk as toolkit, then it get linked to "core foundation" on OS X.
So basically GUI^fork.

fork

Posted Oct 3, 2012 0:41 UTC (Wed) by quotemstr (subscriber, #45331) [Link]

> So basically GUI^fork.

That's a common pattern in GUI systems. On Windows, the NT kernel forks just fine --- it's the Win32 subsystem that can't handle it. Under Cygwin, fork works just fine, but the child doesn't inherit any of the Win32 GUI stuff. I honestly don't think of GUI^fork as a major limitation --- why on earth would you want to use the GUI in the child without execing first? How could you coordinate the parent GUI and child GUI?

fork

Posted Oct 3, 2012 12:16 UTC (Wed) by ballombe (subscriber, #9523) [Link]

The parent has no GUI. It produces a set of data for the child. The fork causes the child to get a snapshot of the data. The child displays the data graphically. If the child were to exec() it would lose the data snapshot.

But my point is while there are various UNIX emulation layer available for windows, even one form MS which is POSIX certified, this does not make Windows a UNIX platform. The situation is increasingly similar on OS X.

fork

Posted Oct 3, 2012 17:47 UTC (Wed) by quotemstr (subscriber, #45331) [Link]

> The fork causes the child to get a snapshot of the data. The child displays the data graphically.

Shared memory.

> this does not make Windows a UNIX platform. The situation is increasingly similar on OS X.

Nobody cares about an OS being a "UNIX platform". People care about an OS being able to run useful software. Forking in a GUI program and doing GUI things in the child *just ain't useful*.

fork

Posted Oct 3, 2012 20:37 UTC (Wed) by dskoll (subscriber, #1630) [Link]

...Shared memory.

What part of "snapshot" is unclear?

fork

Posted Oct 4, 2012 15:28 UTC (Thu) by bronson (subscriber, #4806) [Link]

Wouldn't MAP_PRIVATE work for that? (curious, I've never tried)

fork

Posted Oct 4, 2012 19:23 UTC (Thu) by quotemstr (subscriber, #45331) [Link]

MAP_PRIVATE only works once. You can't use it to create multiple versioned snapshots.

fork

Posted Oct 4, 2012 0:41 UTC (Thu) by mpr22 (subscriber, #60784) [Link]

I'm presuming the amount of data involved would be unreasonable to pass over a pipe.

fork

Posted Oct 4, 2012 15:32 UTC (Thu) by bronson (subscriber, #4806) [Link]

Or that it doesn't serialize well, like trees or video processing data.

fork

Posted Oct 2, 2012 21:42 UTC (Tue) by mjg59 (subscriber, #23239) [Link]

The Core Foundation framework isn't part of POSIX, so has no bearing on how UNIX or otherwise an OS is.


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