Threads freezes other application

  • Thread starter Thread starter Jesse
  • Start date Start date
J

Jesse

I have a C# application that runs fine on any computer (XP,
2000, 98). I have just installed on a PC that also has a
POS which runs in kiosk mode. The problem is that when my
application start running the POS stop responding (or at
least stop repainting screens). My application is a console
application which starts 2 different threads. I debugged
my application and found out that on thread #1 the line of
code affecting the POS is a Thread.Sleep(x); on thread #2
the line is a Monitor.Wait(x).

If I remove those lines from code the POS works fine, but
my application will not work as intended.

I'm suspicious of the [STAThread] attribute on the Main
function.

I will appreciate any kind of help.
 
So if you are suspicious of the entry marking your multi threaded app as
Single Threaded Apartment model, have you tried removing that attribute and
seeing if it fixes the problem?

You don't need the attribute to make the static main class work.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
 

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

Back
Top