single class, hashtable, multiple threads

  • Thread starter Thread starter hharry
  • Start date Start date
H

hharry

Hello All,

I have a single class windows service that includes a function that
runs in the ThreadPool. The class contains a hashtable which is
declared in the main thread.

What is the recommended method of updating a variable declared in the
main thread from a spawned threadpool thread ?


Thanks in advance
 
Be aware also that Hashtable.Synchronized is not really RW safe.
It does synchronize writers, but not readers.
 

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