Re: hang in CFStream code
Re: hang in CFStream code
- Subject: Re: hang in CFStream code
- From: Quinn <email@hidden>
- Date: Thu, 1 May 2003 10:00:50 +0100
At 15:50 -0400 30/4/03, James Matthews wrote:
To correct my own post, the problem wasn't that I was disposing of
the CFReadStream but that I was calling fork() from the callback.
Some questions:
1. Are you using fork or vfork? (fork is safer, vfork is faster)
2. Do you do anything with the CFStream in the child process?
(that would be bad)
3. In the child, what else do you do after the fork and before the exec?
There's a fundamental disconnect between CF and fork. When you fork,
the child inherits all the CF data structures (specifically the
memory and all the file descriptors) except one critical one, the
Mach ports. This causes all sorts of grief, because CFRunLoops are
based on Mach ports. CF does try to detect and recover from this,
but is not always successful.
I don't know whether this is the cause of your specific problem, but
it certainly seems suspect.
S+E
--
Quinn "The Eskimo!" <
http://www.apple.com/developer/>
Apple Developer Technical Support * Networking, Communications, Hardware
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.