Multi threading static method and possible locking
- From: "richard.hallgren@xxxxxxxxx" <richard.hallgren@xxxxxxxxx>
- Date: 29 May 2007 13:21:43 -0700
Hi,
I have a static method that I use for data access. This particular
method reads x number of rows and then updates these rows with a read
= 1 flag. I access this method with several threads and I guess that
one thread (thread A) could read rows and then the next thread (thread
B) would read the same rows BEFORE the first thread has updated
"it's" (all the rows selected by thread A) rows as read - right? Will
it help just wrapping this complete method (the one that read and then
updates the rows as read) in a lock or is that unnecessary in this
case?
.
- Follow-Ups:
- Re: Multi threading static method and possible locking
- From: Nicholas Paldino [.NET/C# MVP]
- Re: Multi threading static method and possible locking
- Prev by Date: Re: single sign on for windows applications or windows services
- Next by Date: Re: Release build not optimizing
- Previous by thread: what does StructLayoutAttribute.Pack do!??
- Next by thread: Re: Multi threading static method and possible locking
- Index(es):
Relevant Pages
|