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
Alan,
The text is in my idea refering in VB.Net to the Synclock procedures
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vastmSyncLock.asp
I hope this helps,
Cor
"Alan Cobb" <alan.spam.off@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> schreef in
bericht news:5k12a211mv70h1r5a8qj0bme8e0568vbd9@xxxxxxxxxx
Hi,
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.
Thanks,
Alan
.
- References:
- 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?
- Index(es):
Relevant Pages
|