<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV><DIV>On Jan 8, 2007, at 5:19 PM, Trevor Jim wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">I don't know that it makes sense to dive into the code just</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">yet as we are investigating some ocaml issues.<SPAN class="Apple-converted-space">  </SPAN>However maybe</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">you or some other person can answer this:</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">Is the Cocoa stuff always multi-threaded?<SPAN class="Apple-converted-space">  </SPAN>That is, if I just</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">compile a regular Cocoa program, say, the hello world equivalent,</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">is the resulting binary multi-threaded?</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">(If not, then we would have the option of removing some of the</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">threaded code we added; but if it is always multi-threaded,</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">that won't help.)</FONT></P> </BLOCKQUOTE></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>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.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>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.</DIV><BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>-- </DIV><DIV>Kevin Ballard</DIV><DIV><A href="http://kevin.sb.org">http://kevin.sb.org</A></DIV><DIV><A href="mailto:kevin@sb.org">kevin@sb.org</A></DIV><DIV><A href="http://www.tildesoft.com">http://www.tildesoft.com</A></DIV><BR class="Apple-interchange-newline"></SPAN> </DIV><BR></BODY></HTML>