FROM : Chris Kane
DATE : Tue Jan 21 20:29:37 2003
On Sunday, January 19, 2003, at 1:50PM, Mark Levin wrote:
>> And pthreads can be used safely in Obj-C apps.
>
> ...aside from the warning in the documentation that the cocoa
> libraries will not become thread-safe unless you use NSThreads?
The previous poster's statement about pthreads and ObjC is literally
true -- pthreads can be used safely within ObjC programs. You
shouldn't attempt to use ObjC (or Cocoa functions) within such threads,
without further precautions, but if you just want a thread to execute
some C code, you don't need to take ObjC and Cocoa multithreaded. The
threads that Foundation itself creates to do some types of operations
asynchronously are generally carefully written in C only so that
Foundation doesn't in fact make the app ObjC-threadsafe (with the
slight performance penalty that incurs).
Chris Kane
Cocoa Frameworks, Apple
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
DATE : Tue Jan 21 20:29:37 2003
On Sunday, January 19, 2003, at 1:50PM, Mark Levin wrote:
>> And pthreads can be used safely in Obj-C apps.
>
> ...aside from the warning in the documentation that the cocoa
> libraries will not become thread-safe unless you use NSThreads?
The previous poster's statement about pthreads and ObjC is literally
true -- pthreads can be used safely within ObjC programs. You
shouldn't attempt to use ObjC (or Cocoa functions) within such threads,
without further precautions, but if you just want a thread to execute
some C code, you don't need to take ObjC and Cocoa multithreaded. The
threads that Foundation itself creates to do some types of operations
asynchronously are generally carefully written in C only so that
Foundation doesn't in fact make the app ObjC-threadsafe (with the
slight performance penalty that incurs).
Chris Kane
Cocoa Frameworks, Apple
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
| Related mails | Author | Date |
|---|---|---|
| Tackel | Jan 19, 18:07 | |
| Nicholas Riley | Jan 19, 18:34 | |
| Shaun Wexler | Jan 19, 18:55 | |
| Philip George | Jan 19, 21:12 | |
| Brent Gulanowski | Jan 19, 21:47 | |
| Daryn | Jan 19, 22:33 | |
| Mark Levin | Jan 19, 22:50 | |
| Philip George | Jan 20, 02:08 | |
| Chris Kane | Jan 21, 20:29 |






Cocoa mail archive

