Re: Thread safety of DataTable class - Filling on background thread OK?
- From: "Cor Ligthert [MVP]" <notmyfirstname@xxxxxxxxx>
- Date: Tue, 27 Jun 2006 12:59:56 +0200
The text is in my idea refering in VB.Net to the Synclock procedures
I hope this helps,
"Alan Cobb" <alan.spam.off@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> schreef in
The DataTable documentation says:
"This type is safe for multithreaded read operations.
You must synchronize any write operations."
So I should be able to do the following safely?
Create and fill a DataTable on a worker thread and then
pass that same DataTable object over to the GUI thread.
Then as long as the worker thread no longer touches
the DataTable, the GUI thread can read and write to it
all it wants?
Or the GUI thread could create the DataTable and pass it
to the worker thread for filling?
Or both threads could even write to the same DataTable
over time, as long as they used some kind of lock to
insure only one wrote at a time?
I would be nice if the documentation explicitly said which
methods were thread safe. That is, which involved only
"read" operations and hence could be done at any time
from any thread.
- Prev by Date: Thread safety of DataTable class - Filling on background thread OK?
- Next by Date: Group by on dataset tables
- Previous by thread: Thread safety of DataTable class - Filling on background thread OK?
- Next by thread: Re: Thread safety of DataTable class - Filling on background thread OK?