By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,030 Members | 2,277 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,030 IT Pros & Developers. It's quick & easy.

Logging in different thread ?

P: n/a
Hi,

Does someone has an example of logging in a different thread ? Native
Windows API had a mechanism to send thread message(which could be used to
send a message with log data details). Does .NET has an equivalent ?

Thanks in advance and regards

Navin
Jul 21 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
"Navin Mishra" <Na**********@icn.siemens.com> wrote in message
news:uN**************@TK2MSFTNGP12.phx.gbl...
Hi,

Does someone has an example of logging in a different thread ? Native
Windows API had a mechanism to send thread message(which could be used to
send a message with log data details). Does .NET has an equivalent ?


..NET has several mechanisms you can use to communicate date between threads.
This data could certainly be logging data.

For example, you could use remoting, or a properly synchronized Queue, or
just about anything in between.

You might also write your logging code to be asynchronous, so that it's fast
enough that you don't need to explicitly use a separate thread.

John Saunders
Jul 21 '05 #2

P: n/a
Thanks. Is there any example ? That'd be great!

"John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
news:OC**************@TK2MSFTNGP11.phx.gbl...
"Navin Mishra" <Na**********@icn.siemens.com> wrote in message
news:uN**************@TK2MSFTNGP12.phx.gbl...
Hi,

Does someone has an example of logging in a different thread ? Native
Windows API had a mechanism to send thread message(which could be used to
send a message with log data details). Does .NET has an equivalent ?


.NET has several mechanisms you can use to communicate date between
threads. This data could certainly be logging data.

For example, you could use remoting, or a properly synchronized Queue, or
just about anything in between.

You might also write your logging code to be asynchronous, so that it's
fast enough that you don't need to explicitly use a separate thread.

John Saunders

Jul 21 '05 #3

P: n/a
"Navin Mishra" <Na**********@icn.siemens.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Thanks. Is there any example ? That'd be great!
Sorry, I don't have an example of remoting or other simple inter-thread
communication.

John Saunders
"John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
news:OC**************@TK2MSFTNGP11.phx.gbl...
"Navin Mishra" <Na**********@icn.siemens.com> wrote in message
news:uN**************@TK2MSFTNGP12.phx.gbl...
Hi,

Does someone has an example of logging in a different thread ? Native
Windows API had a mechanism to send thread message(which could be used
to send a message with log data details). Does .NET has an equivalent ?


.NET has several mechanisms you can use to communicate date between
threads. This data could certainly be logging data.

For example, you could use remoting, or a properly synchronized Queue, or
just about anything in between.

You might also write your logging code to be asynchronous, so that it's
fast enough that you don't need to explicitly use a separate thread.

John Saunders


Jul 21 '05 #4

P: n/a
Navin Mishra <Na**********@icn.siemens.com> wrote:
Does someone has an example of logging in a different thread ? Native
Windows API had a mechanism to send thread message(which could be used to
send a message with log data details). Does .NET has an equivalent ?


The simplest solution would be to just use a producer/consumer model.

See http://www.pobox.com/~skeet/csharp/t...eadlocks.shtml (second
half thereof) for an example.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.