Threading Question

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

Cor Ligthert [MVP]

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
 
M

m.posseth

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]
 

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

Similar Threads


Top