Re: Synchronizing GUI-code necessary?
Re: Synchronizing GUI-code necessary?
- Subject: Re: Synchronizing GUI-code necessary?
- From: Shawn Erickson <email@hidden>
- Date: Wed, 31 Mar 2004 09:49:01 -0800
To be better stated (out my attempt at it) that events are received and
handled in serial fashion by the main thread's run-loop (or sometimes
by a secondary nested run-loop). A Cocoa application can have any
number of threads if you code it use them. In general you do not need
to worry about it when using the normal event process paradigm provided
you.
I would review docs on event handling [1] and run-loops [2]. Also docs
on general application architecture [3] (the topics of most relevance
are being worked on it looks like).
-Shawn
[1]
<
http://developer.apple.com/documentation/Cocoa/Conceptual/
BasicEventHandling/index.html>
[2]
<
http://developer.apple.com/documentation/Cocoa/Conceptual/
InputControl/index.html>
[3]
<
http://developer.apple.com/documentation/Cocoa/Conceptual/
AppArchitecture/index.html>
On Mar 30, 2004, at 8:31 PM, Michael Rothwell wrote:
A Cocoa GUI is single-threaded.
Michael Rothwell
email@hidden
On Mar 30, 2004, at 8:49 PM, Christoffer Lerno wrote:
Hi,
I'm pretty new to cocoa, so I run into all sorts of questions. One is
in regards to receiving input from the GUI.
Let's say I have code like this:
- (void)keyDown:(NSEvent *)theEvent
{
myValue=myValue2+myValue3;
myValue3=myValue2/2+myValue;
myValue2=myValue/2;
}
Do I need to synchronize this block? I.e. are the messages from the
GUI multithreaded and do I need to worry about it?
_______________________________________________
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.
_______________________________________________
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.
_______________________________________________
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.