Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: kqueue on OS X



BSD pipes are thread safe. 9/10 of their semantics are implemented in the kernel anyway. What they aren't is atomic, they're buffered, so if you write unstructed data to them and have arbitrary readers and writers you'd better keep things straight some other way.

- Jordan

On Feb 17, 2004, at 4:39 PM, Glen Low wrote:

Scott:

On 18/02/2004, at 8:23 AM, Scott Lamb wrote:

On Feb 17, 2004, at 6:01 PM, Glen Low wrote:
Now pipes and file descriptors seem dangerous to me, since they are not necessarily threadsafe (especially with Cocoa)

Now, this is definitely not true. Two threads should be able to talk to each other on opposite ends of the same pipe without problem. And Cocoa doesn't have to enter the picture - you can use the raw system calls.


According to:

http://developer.apple.com/documentation/Cocoa/Conceptual/ Multithreading/Tasks/foundation.html

It says facilities which are generally thread-unsafe are:

... NSPipe ...

I am unsure if the underlying BSD pipe implementation is threadsafe, I can't see this one way or another by googling.

Cheers, Glen Low


---
pixelglow software | simply brilliant stuff
www.pixelglow.com
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.

---
Jordan Hubbard,
Engineering Manager, BSD Technology Group
Apple Computer
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: kqueue on OS X (From: Glen Low <email@hidden>)
 >Re: kqueue on OS X (From: Scott Lamb <email@hidden>)
 >Re: kqueue on OS X (From: Glen Low <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.