|
-
Dec 13th, 2010, 06:30 PM
#1
Thread Starter
New Member
Re: Multithreading questions
 Originally Posted by Shaggy Hiker
As for the threading, what you are describing is not inherently thread safe, but the way you say you are using it will make it effectively thread safe. The objects are not tied to a thread, but if each thread works with one and only one of the objects, then, by your design, no two threads will ever be running the same code segment. This will not be true if you have shared methods in those objects, since shared methods are not specific to any one object, but otherwise each one will be isolated. You could have trouble if thread A creates a dbOps and ANY other thread is able to call methods against that instance, but you stated that you were not doing that, so you should be fine.
Maybe I should ask the question is it better to have one dbops class that all the threads call common code (using synclock) or to keep it the way I have it?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|