PC Review


Reply
Thread Tools Rate Thread

Re: Dataset Thread Safety

 
 
David Browne
Guest
Posts: n/a
 
      9th Sep 2004

"edwwsw" <(E-Mail Removed)> wrote in message
news:3AE7438F-6C07-43AF-A2B5-(E-Mail Removed)...
>$ Thread Safety
> $ This type is safe for multithreaded read operations. You must
> synchronize
> any write operations.
>
> I am trying to figure out exactly what this statement means.
>
> So if I have multiple threads accessing an ADO.Net dataset and only one of
> those threads ever writes to the database but multiple threads are reading
> from it. Do I have to write code to synchronize access to the ADO.Net
> dataset or is that built into the Ado.Net dataset? Basically are updates
> atomic and are the events guarentteed to fire in the UI thread?


Updates are not atomic, and you must have exclusive access to the DataSet to
update it.

But winforms events are guaranteed to fire in the UI thread. When a user
clicks a button or hits a key this queues a message in the window's message
queue. The UI thread dequeues these messages one at a time and dispatches
to the event handler. So UI events are guaranteed to run on the UI thread,
and are therefore serialized.


David


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Typed Dataset Thread Safety Dave T Microsoft ADO .NET 2 15th Feb 2008 07:29 PM
Typed Dataset Thread Safety Dave T Microsoft ASP .NET 2 15th Feb 2008 07:29 PM
Thread safety in disconnected ADO.NET dataset Navin Mishra Microsoft Dot NET 1 22nd Nov 2005 11:58 AM
Re: Dataset Thread Safety Miha Markic [MVP C#] Microsoft ADO .NET 0 9th Sep 2004 08:59 PM
Thread Safety, dataset and dataview, ASP.NET Arthur Dzhelali Microsoft Dot NET 1 22nd Jul 2004 06:25 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:13 PM.