threads

  • Thread starter Thread starter csharpula csharp
  • Start date Start date
C

csharpula csharp

Hello,
I would like to consult about thread usage in my application.
I got a console application which is activating a process and I need to
update a log file during this process. My question is : do I need to use
another thread for updating th log or can i do it in the same thread
with the console application?

Thank u!
 
As long as you don't have 2 threads fighting over the same log, it
should be fine on the same thread. It doesn't sound like you are doing
anything parallel, so I probably wouldn't bother with the extra
thread.

Marc
 
I tend to steer away from multipl threads if possible.

While on the face of it they should speed things up I found in
practice in some cirumstances two can take longer than one !
There is clearly overhead getting 2 processors to do 2 threads.

I looked at a program of mine in regard to multi processor working and
the only place I could use multipler threads was teh clearing of a
huge buffer.

I split the sbuufer int o4 threads each thread clearing a quarter.

I times both single and multiple threads and the multiple threads was
much slower !

For me the proof is in the eating and in this case threads were not
the way......
 

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