M
Max Adams
All,
I have a multithreaded app (using threadpool). I was under the illusion
that where I used lock( this ) around a segment of code that only one thread
would be allowed access to that segment of code at a time.
The scenario I have is that a part of code creates a document "new.txt" (for
simplicity) and zips it up, I only ever want one "new.txt" so I put this
code inside a lock( this ), however having reviewed my code this does not
act as desired; I see many threads inside this locked section at the same
time :-/
Am I missing something?
MA
I have a multithreaded app (using threadpool). I was under the illusion
that where I used lock( this ) around a segment of code that only one thread
would be allowed access to that segment of code at a time.
The scenario I have is that a part of code creates a document "new.txt" (for
simplicity) and zips it up, I only ever want one "new.txt" so I put this
code inside a lock( this ), however having reviewed my code this does not
act as desired; I see many threads inside this locked section at the same
time :-/
Am I missing something?
MA