On Jul 9, 2009, at 2:46 AM, Julien Isorce wrote:
I am trying to isolate this difference in order to avoid to run the main
loop in the main thread.

Don't bother. Cocoa is quite explicitly designed to not support event processing on any thread other than the main thread. No amount of "trying to isolate" Cocoa functionality into a thread will make it work.

Because I have no access to the main thread.

The only way you can't have access to the main thread is if you are using a piece of software for which you have either no source or don't have the ability -- the rights, most typically -- to modify said source.

If you have the source, modify it so that whatever it is that is consuming the main thread is no longer on the main thread.

You'll need to give some more information on exactly what it is you are trying to do -- what you are trying to integrate with -- to gain more help.

I am still suprising of a such limiation of Cocoa on MacOSX while it works
perfectly with GNUstep.

Think it through; why would Apple or NeXT waste engineering resources making this work? Making anything thread safe -- especially complex things -- is extremely difficult and there is always a performance hit for doing so. Always.

And doing so offers what feature or advantage to the developer?

Event processing is an inherently linear process. You generally cannot respond to the next event until the current event is fully processed. Efficiency is generally obtained by coalescing related events -- sequences of key events while typing -- or by ignoring events like mouse moves when they aren't relevant.

b.bum
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to