It is possible for a process to have more than one 'thread of execution' i.e. to be able to do more than one thing at once.
When this occurs, the process is said to be multi-threaded as opposed to single-threaded when there is only a single thread.
Unless your machine has multiple processors or cores, multi-threading is an illusion. The operating system makes it look as though the process is doing two or more things concurrently by switching between the threads at short intervals - a so called 'context switch'.
The Reader-Writer problem occurs when multiple threads share the same area of memory with some reading from and others writing to the shared memory at the same time.
To avoid the chaos which would result from this, there needs to be some mechanism which ensures that no thread can read from shared memory whenever another thread is writing to it. The mechanism which is often used is called a 'lock'. Whenever one thread obtains a lock on an object in shared memory, the other threads have to queue up until the lock is released.
VulpesPosted Apr 14, 2014, 6:37 AM
Munesh SharmaPosted Apr 14, 2014, 6:02 AM
http://social.msdn.microsoft.com/Forums/en-US/c8a11bc3-87ad-431e-bc37-82f8d9949524/readers-writers-problem-in-netc?forum=adodotnetdataproviders
Anurag SarkarPosted Apr 14, 2014, 4:23 AM
http://msdn.microsoft.com/en-us/library/ms173178.aspx
http://www.codeproject.com/Articles/8694/Multithreading-Concepts-in-C
http://msdn.microsoft.com/en-us/library/aa645740%28v=vs.71%29.aspx