Threading

  • Thread starter Thread starter Doug
  • Start date Start date
D

Doug

Hi,

I am looking to write my first application that will use threading. I
understand the concept but am not that familiar with the details of how
to make this work in code. Does anyone have any suggestions on some
good books out there that talk about this topic? Issues that I'm
looking at are how to make sure I am actually able to start seperate
threads that will run concurrently and ensuring the best way to handle
when/if a thread aborts (without affecting other threads).
 
Doug said:
Hi,

I am looking to write my first application that will use threading. I
understand the concept but am not that familiar with the details of how
to make this work in code. Does anyone have any suggestions on some
good books out there that talk about this topic? Issues that I'm
looking at are how to make sure I am actually able to start seperate
threads that will run concurrently and ensuring the best way to handle
when/if a thread aborts (without affecting other threads).

The best way is:
Don't let a thread abort. Use a top-level try-catch block in your thread
procedure, don't ever call Thread.Abort, and avoid stack overflows.

When you have an error condition, you can throw an exception to notify the
caller, but the thread procedure should always catch this, deallocate any
remaining resources, and exit cleanly.
 
Back
Top