|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
pass to background threadhey all,
i have a shared sub called WriteToErrorLog(msg as String) for obvious purposes. How do i send that to a background thread? i'm stuck on the part where thread.start executes a subroutine that doesn't accept parms (or can it?) how do i get the message parm into the background sub? 2nd question: is this worth the trouble? thanks, ari Ari,
If you use a backgroundthread, than you should in my opinion forever think that it is meant to create a result to a foregroundthread. All other purposes of threading let mostly to no results. In those cases will services with their own thread work better. However mostly is using threads not worth the trouble. (Exept as you are sure that the background processes are acting really assynchroon). Just my thought, Cor Show quoteHide quote "ari" <a**@discussions.microsoft.com> schreef in bericht news:4BD00470-869B-4AA3-AF11-20583A89C8A6@microsoft.com... > hey all, > > i have a shared sub called WriteToErrorLog(msg as String) for obvious > purposes. How do i send that to a background thread? i'm stuck on the part > where thread.start executes a subroutine that doesn't accept parms (or can > it?) how do i get the message parm into the background sub? > > 2nd question: is this worth the trouble? > > thanks, > ari ari wrote:
> hey all, There's already a lot of information out there on getting threads to> > i have a shared sub called WriteToErrorLog(msg as String) for obvious > purposes. How do i send that to a background thread? i'm stuck on the part > where thread.start executes a subroutine that doesn't accept parms (or can > it?) how do i get the message parm into the background sub? > pick up parameters. Just google for it. > 2nd question: is this worth the trouble? No. I see no benefit in a background thread processing log messages.> It would probably wind up being slower anyway. How much slower depends on how you implemented it. But that's not the worst of it. Threading just complicates the process of getting the error information to a log. The last thing you want to happen after an error occurs is losing that information because of another error in the logging code. Show quoteHide quote > thanks, > ari thanks very much for the feedback.
Show quoteHide quote "Brian Gideon" wrote: > > ari wrote: > > hey all, > > > > i have a shared sub called WriteToErrorLog(msg as String) for obvious > > purposes. How do i send that to a background thread? i'm stuck on the part > > where thread.start executes a subroutine that doesn't accept parms (or can > > it?) how do i get the message parm into the background sub? > > > > There's already a lot of information out there on getting threads to > pick up parameters. Just google for it. > > > 2nd question: is this worth the trouble? > > > > No. I see no benefit in a background thread processing log messages. > It would probably wind up being slower anyway. How much slower depends > on how you implemented it. But that's not the worst of it. Threading > just complicates the process of getting the error information to a log. > The last thing you want to happen after an error occurs is losing that > information because of another error in the logging code. > > > thanks, > > ari > >
Local Machine policy exceptions
VB.NET or C#.NET ??? Is there a difference between passing "" and passing Nothing to a Windows API ? Moving a project from 2003 to 2005 TCP/IP Socket communication from multiple clients reading text files Open a text file and into an array ?? Help to Italy Must I change the property in 26 projects or is there a soultion level way of doing it Usual Databinding Question - UNusual Requirements |
|||||||||||||||||||||||