[Unison-hackers] MAC OS issue ... only with the GUI version

Kevin Ballard kevin at sb.org
Sat Jan 13 05:12:56 EST 2007


On Jan 8, 2007, at 5:19 PM, Trevor Jim wrote:

> I don't know that it makes sense to dive into the code just
> yet as we are investigating some ocaml issues.  However maybe
> you or some other person can answer this:
>
> Is the Cocoa stuff always multi-threaded?  That is, if I just
> compile a regular Cocoa program, say, the hello world equivalent,
> is the resulting binary multi-threaded?
>
> (If not, then we would have the option of removing some of the
> threaded code we added; but if it is always multi-threaded,
> that won't help.)

Foundation, by default, doesn't do any threading. AppKit, by default,  
does. As soon as you start doing anything with AppKit it's going to  
mark the app as multithreaded, as it likes to use background  
"heartbeat" threads to do stuff. Similarly, things like loading URLs  
uses background threads, as do other tasks.

That said, the GUI stuff always runs on the main thread. Any event  
triggered by a GUI action is going to be processed on the main  
thread. Similarly, any time your code wants to manipulate the GUI it  
should be doing it from the main thread. It's possible to do it from  
a background thread, as it won't complain, but there's no guarantee  
it will work and race conditions will almost certainly be present in  
your code.

-- 
Kevin Ballard
http://kevin.sb.org
kevin at sb.org
http://www.tildesoft.com


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.seas.upenn.edu/pipermail/unison-hackers/attachments/20070113/c2faa6d1/attachment-0001.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2432 bytes
Desc: not available
Url : http://lists.seas.upenn.edu/pipermail/unison-hackers/attachments/20070113/c2faa6d1/smime-0001.p7s


More information about the Unison-hackers mailing list