threading scenario

  • Thread starter Thread starter rein.petersen
  • Start date Start date
R

rein.petersen

Hi All,

I'm accessing a scanner programatically (using WIA automation) and I
want to make the application multithreaded to allow the foreground UI
to be accessible while calls to the scanner occur in the background. Of
course, when I suggest multi-threaded, I really only want the main
thread to control the UI while a second thread controls the scanner. I
don't want multiple threads accessing the scanner - just a single
thread that I can query if it is busy or free.

Is there a design pattern I should consider?

Thanks,

Rein
 
If the thread doing the scanning is purely a background thread (i.e. you
don't need to interrupt it, or necessarily know when it's done), then I
suggest looking at the ThreadPool.QueueUserWorkItem method.
 

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