Threading Question

  • Thread starter Thread starter Terry Olsen
  • Start date Start date
T

Terry Olsen

I have a data table that several threads need to read from & write to (using
threadpool class).

What is the best way to make it safe for each thread to access this table?
My program works, but I know this is sloppy. In each thread I have
something like this:

TryAgain:
Try
Read/Write to DT
Catch
GoTo TryAgain
End Try

Any advice is appreciates...
 
Terry,

You know that using threads in dataacces (when it is about one database
server) will normally make only that your program is using more resource and
acts slower.

Just my thought,

Cor
 
the best way ???

well is there a best way , as there is always another way with its own
advantage and dissadvantage

However Terry to answer your question what would be a better way for your
program to handle the possibility to access the same table from multiple
threads
use a Thread lock infrastructure


regards


Michel Posseth [MCP]
 
Back
Top