A
Alan Cobb
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
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