multi thread access to files and database connections

  • Thread starter Thread starter Keith Langer
  • Start date Start date
K

Keith Langer

I have several threads which log messages to the same resources, such
as a text file, event log, or database connection. What is the best
way to log these messages? Should I be using delegates, or can each
thread directly access these resources? Anyone have some examples?

thanks,
Keith
 
Keith,

It would be much better to add your messages to a shared queue and
have a single thread actually writing the messages to your file. I
would apply this to a database connection as well.

Regards,
Jim
 

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