tag:blogger.com,1999:blog-34442452.post551830802875554480..comments2023-04-16T03:49:21.961-07:00Comments on Cocoa Samurai: A Guide to Threading on LeopardColin Wheelerhttp://www.blogger.com/profile/16010768305821496589noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-34442452.post-12156541695462771832008-11-22T22:49:00.000-08:002008-11-22T22:49:00.000-08:00Thanks for the article. It was very helpful. Can I...Thanks for the article. It was very helpful. Can I ask two simple questions about implementing a class that inherits NSThread?<BR/>(1) Is it ok (or recommended) to create the NSAutoreleasePool at the start of the over-ridden main method, and release it at the end of that method?<BR/>(2) If you release an instance of a class that inherits NSThread after the thread has been started, it seems (from Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-34442452.post-76168459661633748182008-04-27T01:50:00.000-07:002008-04-27T01:50:00.000-07:00Thanks Colin, that's a great introduction to the n...Thanks Colin, that's a great introduction to the new threading features that are available in Leopard.<BR/><BR/>What might come in handy if you're to mix Cocoa threads with pthreads is <A HREF="http://developer.apple.com/documentation/Cocoa/Conceptual/Multithreading/CreatingThreads/chapter_4_section_4.html" REL="nofollow">this little section</A> in Apple's documentation.<BR/><BR/>Happy threading.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-34442452.post-71602949291952279642008-04-14T17:05:00.000-07:002008-04-14T17:05:00.000-07:00Worth mentioning as well is the OSSpinLock{Lock, U...Worth mentioning as well is the OSSpinLock{Lock, Unlock} combination; these busy-wait, but are by far the cheapest to acquire/release. In the case of many resources and lightweight access (very few threads, and/or little work being done per access), they may pay off significantly.<BR/><BR/>Consider the set/get methods for 10000 objects. Creating an OSSpinLock for each object is cheap (it's just Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-34442452.post-82036318815431746752008-04-14T09:32:00.000-07:002008-04-14T09:32:00.000-07:00At the beginning campanion should be companion.Oth...At the beginning campanion should be companion.<BR/><BR/>Otherwise thanks for a great and helpful article.tarasishttps://www.blogger.com/profile/09004397739841551976noreply@blogger.comtag:blogger.com,1999:blog-34442452.post-5559616139357128512008-04-13T11:16:00.000-07:002008-04-13T11:16:00.000-07:00no that is a misprint, sorry. It is 90 microsecond...no that is a misprint, sorry. It is 90 microseconds to create a thread. It's been corrected.Colin Wheelerhttps://www.blogger.com/profile/16010768305821496589noreply@blogger.comtag:blogger.com,1999:blog-34442452.post-28337137441126886312008-04-13T10:35:00.000-07:002008-04-13T10:35:00.000-07:00Is 90ms a misprint? Does it really take that long...Is 90ms a misprint? Does it really take that long, or should it be microseconds?Anonymousnoreply@blogger.com