Tim Hibbard

CEO for EnGraph software
posts - 628 , comments - 1634 , trackbacks - 459

My Links

News



Add to Google

Twitter












Tag Cloud

Article Categories

Archives

Post Categories

Image Galleries

EnGraph Blogs

Links

Other

Roll

Using SyncLock

I have a situation where it is possible that two threads may try to access the same file. I am thinking about putting the filename in an arraylist when it is being accessed and then removing the filename when the process is finished. But now I have two threads using the same arraylist. I thought about using a SyncLock on the arraylist before I look to see if the filename is in there, but I've read that is a dangerous habit. Anybody have any thoughts?

Print | posted on Wednesday, February 16, 2005 3:23 PM |

Feedback

Gravatar

# re: Using SyncLock

In case you haven't come across this already, then maybe this should help:
http://www.yoda.arachsys.com/csharp/threads/lockchoice.shtml

its in C# = shows how to use the lock statement (SynLock in VB.NET).
2/17/2005 9:23 AM | Imran Koradia
Gravatar

# re: Using SyncLock

Thanks...i ended up reworking the application to avoid the problem entirely.
2/18/2005 1:40 AM | Tim Hibbard
Gravatar

# re: Using SyncLock

do it.
5/21/2007 2:20 PM | No
Gravatar

# re: Using SyncLock

go ahead 50W LED flood light
7/16/2011 1:31 AM | LED downlights
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 
 

Powered by: