GUI update, multi-threaded Cocoa Java app
GUI update, multi-threaded Cocoa Java app
- Subject: GUI update, multi-threaded Cocoa Java app
- From: "John W. Whitworth" <email@hidden>
- Date: Mon, 22 Apr 2002 08:39:34 +0100
What is the accepted wisdom on updating a Cocoa Java GUI from Java
threads producing data?
No distributed objects in Cocoa Java.
Selectors invoked by notifications don't run in the main run loop but in
the threads sending the notification.
I tried passing a reference to the main run loop to the threads so that
they could schedule a selector call (performSelectorWithOrder) but this
didn't work.
All I could come up with was a repeating timer updating the GUI in the
main run loop from data posted from the threads via synchronized methods.
I guess some kind of producer/consumer synchronization might be possible
between the main and spawned threads. There must be an elegant solution,
such as the swing invokelater call.
John Whitworth
_______________________________________________
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.