[Openmcl-devel] thread overview

alex crain alexcrain at mail2.widgetworks.com
Sun Aug 22 17:43:54 PDT 2004


On Aug 22, 2004, at 5:50 PM, Gary Byers wrote:

>
>
> On Sun, 22 Aug 2004, alex crain wrote:
>
>>
>> All the thread stuff makes sense, including giving a dedicated thread
>> to each edit window,
>> but why is there a separate houskeeping thread for COCOA? Why not just
>> use the main
>> thread for that stuff since it already runs the periodic events?
>>
>
> The main (initial) thread isn't "already running periodic events" in 
> the
> Cocoa environment, it's waiting for and handling Cocoa events.
>
Ok, tell me if I've got this right:

openmcl starts with a main thread and a listener thread. When cocoa 
starts, it co-opts the
main thread to handle cocoa events. This thread is then used to spawn 
other cocoa related
threads, like the ones associated with hemlock windows.

Since the main thread is busy responding to cocoa events, it's not 
doing the periodic tasks
anymore, so the main thread (now the cocoa event thread) spawns a new 
thread to do
housekeeping.

So, when I send a keystroke to a hemlock window, which thread does the 
actual processing?
Is it the hemlock window thread, or does the main thread receive the 
event and pass it to the
appropriate place?

:alex




More information about the Openmcl-devel mailing list