threads

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • csharpula csharp

    threads

    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!



    *** Sent via Developersdex http://www.developersdex.com ***
  • Marc Gravell

    #2
    Re: threads

    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

    Comment

    • Marra

      #3
      Re: threads

      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......

      Comment

      Working...