Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Multithreading and NSLock

Multithreading and NSLock
Thread Tools
Professional Poster
Join Date: Apr 2001
Location: Long Beach, CA
Status: Offline
Reply With Quote
Sep 27, 2002, 10:40 PM
 
I'm just wondering if this is bad programming style... I have an object that is generally going to be used in a multithreaded environment. I want this object to be lockable. I'm thinking of just subclassing NSLock instead of instantiating an NSLock inside of it and passing the lock requests to that. Am I just crazy here? For some reason, I'm just looking at this idea and thinking it's a silly thing to do. Any opinions?

Note: this will be a single object referenced by multiple threads.

ACSA 10.4/10.3, ACTC 10.3, ACHDS 10.3
     
Senior User
Join Date: Jan 2000
Location: Burlington, VT, USA
Status: Offline
Reply With Quote
Sep 30, 2002, 11:54 AM
 
Originally posted by Detrius:
I'm just wondering if this is bad programming style... I have an object that is generally going to be used in a multithreaded environment. I want this object to be lockable. I'm thinking of just subclassing NSLock instead of instantiating an NSLock inside of it and passing the lock requests to that. Am I just crazy here? For some reason, I'm just looking at this idea and thinking it's a silly thing to do. Any opinions?

Note: this will be a single object referenced by multiple threads.
you would only want to subclass NSLock if you want to inherit it's functions, ie: if you are changing the way it performs a lock...
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 01:51 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2