Re: Cocoa objects in pthreads
Re: Cocoa objects in pthreads
- Subject: Re: Cocoa objects in pthreads
- From: Raphael Sebbe <email@hidden>
- Date: Thu, 21 Feb 2002 13:21:19 +0100
You should find what you need in there :
http://www.stepwise.com/Articles/Technical/2001-03-20.01.html
(Basically using NSPorts attached to the main thread runloop)
For the autorelease pools,
myPool = [[NSAutoreleasePool] alloc] init];
and when you want to release the associated autoreleased objects,
[myPool release];
Raphael
On Wednesday, February 20, 2002, at 09:01 PM, Luke Bellandi wrote:
Can anyone shed some light for me as to how to appropriately access and
modify Cocoa objects from a pthread run loop?
We've got an application that needs to use pthreads because we set the
thread policy and priority (otherwise we'd probably use NSThread.) It
seems
like we can't safely modify Cocoa objects from these pthread run loops
(specifically: update display ui widgets) since apparently autorelease
pools
are tied to threads (so when we're running in our pthread body, there's
no
knowledge for the ui widget of its owning application thread's
run-loop, or
corresponding autorelease pool.)
Is there a way to set up a new autorelease pool for a thread? Or
(better
yet) to add another thread as a client of an existing autorelease pool?
Thanks!
Luke Bellandi
CoreAudio
Apple Computer
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.