Re: Multiple Threaded Windows
Re: Multiple Threaded Windows
- Subject: Re: Multiple Threaded Windows
- From: Chris Scharver <email@hidden>
- Date: Fri, 10 Oct 2003 08:55:10 -0500
On Tuesday, October 7, 2003, at 02:08 PM, Chris Hanson wrote:
According to that document, more of AppKit is thread-safe than I
thought it was (and much more than used to be -- especially in the
OpenStep days when I first learned it). But I'm still *extremely*
wary of dealing with human interfaces in multiple threads.
Unfortunately, both the developer documentation and mailing list
archives don't go into much beyond paragraphs mentioned by others. I've
read the same paragraphs, but there is very little describing how to
actually do something. Because I'm using existing code which works with
X11 and Win32, I cannot radically alter the library's design. My goal
is to determine how I can fit Cocoa into this design (if at all!) Thus
far, the results haven't been very encouraging, but there's probably a
lot that I'm not correctly taking into consideration.
Also, threads are flows of execution. Objects do not "live" in any
particular thread, they live in a task (address space). So just
because one thread created an object does not mean that object
"belongs" to the thread.
I meant only to indicate that the windows and views are created in the
threads, and therefore functions called from main to do not directly
access any of those objects. Some platforms running this code use
fork() rather than threads, so those semantics are still kept in place
whether using multiple threads or multiple processes. With the
library's other windowing environments, drawing surfaces live safely on
the child threads without interference from the main process. Trying to
discover the required steps to implement similar behavior using Cocoa
is a challenge. I may just have to stick to X11 or forgo drawing to
multiple windows.
I'll try to extract all the code into a simple example so that I can
get a bug report filed on the kernel panic.
Thanks,
Chris
--
Chris Scharver
Electronic Visualization Laboratory
The University of Illinois at Chicago
_______________________________________________
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.