[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: luuid vs. forks
- From: Alexander Gladysh <agladysh@...>
- Date: Tue, 9 Feb 2010 00:47:35 +0300
>> I'd like to avoid writing my own libuuid for OS X though...
> Ah, I see. Obviously, that library isn't fork-safe. I think on Mac
> OS X, the focus is on threading and not so much on forking, so you're
> better off switching from a fork() to a fork()/execve() combination.
Not a good news.
> Chances are that other libraries you might use don't survive forking,
I rarely need to use the same library both in child and parent. I do
forking in tests only. The test code is executed in parent process,
child forks are used to run services being tested.
> fork() is unsafe, really.
Well, unless there is some trick to transform fork() to
fork()/execve() without rewriting existing code, replacing it is not
I'd more likely drop OS X as a supported platform — I'm only using it
for development anyway.
However, I'd like keep OS X support. Perhaps there is fork-safe
libuuid implementation for OS X? MacPorts do have something named
ossp-uuid, perhaps I should try that...