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
 
Back
Top