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: Not thread safe events?



On Oct 19, 2005, at 11:50 AM, Eric Schlegel wrote:


Actually, this isn't quite right; there is only one event dispatcher target, and it only applies to the main thread. There is no event dispatcher target for a secondary thread.

Generally, the way apps use events posted to secondary threads would
be by calling ReceiveNextEvent on that thread's event queue, and
after the event is returned, just unpacking it and handling it right
there in the loop, without sending it to any further event target.

-eric

Ah! I had been wondering if I had an extra step in there. However, when I "SendEventToEventTarget" from the second thread to a target of the Event Dispatcher, it seems to execute the installed handler in the second thread as expected. But even if it's working, I can see that it is redundant if there are no other event targets in the thread.


Scott
-----
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to 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.