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

pass to background thread

P: n/a
ari
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
Feb 13 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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

"ari" <ar*@discussions.microsoft.com> schreef in bericht
news:4B**********************************@microsof t.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

Feb 13 '06 #2

P: n/a

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


Feb 13 '06 #3

P: n/a
ari
thanks very much for the feedback.

"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


Feb 14 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.