Multiple threads in unit test

B

Bryan Ax

We have some code that's having problems when multiple applications
running as different identities try to hit this code - the code creates
a Mutex, and when the second identity tries to access it, it fails
because the Mutex currently has the permissions of the first identity,
along the lines of this article:

http://bobmoore.mvps.org/Win32/w32tip7.htm

I'm trying to create a unit test to recreate this situation so that I
can get it to fail, and therefore, fix the Mutex problem and make sure
it works correctly. However, I'm more of a web developer, so am having
some problems with threading.

I'm able to create multiple threads in a unit test, i.e.:

ThreadStart threadDelegate = new ThreadStart(SomeClass.SomeMethod);
Thread newThread = new Thread(threadDelegate);
newThread.Start();

ThreadStart thread2 = new ThreadStart(SomeClass.SomeMethod);
Thread newThread2 = new Thread(thread2);
newThread2.Start();

but I need to do this where these threads are running under different
identities. Any help appreciated.

Bryan
 
S

sdbillsfan

Hmmm, my math might be a bit off here but I believe

Web developer +
run multiple threads under different credentials
= Asp.net app
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top