![]() they only want to read the data from the object and some of the processes are writers i.e. The code for a writer process is shown in Fig.The readers-writers problem relates to an object such as a file that is shared between multiple processes.In the solution to the first readers-writers problem, the reader processes share the following data structures:.In the second case, readers may starve. ![]() A solution to either problem may result in starvation.In other words, if a writer is waiting to access the object, no new readers may start reading. The second readers-writers problem requires that, once a writer is ready, that writer performs its write as soon as possible.In other words, no reader should wait for other readers to finish simply because a writer is waiting. The simplest one, referred to as the first readers-writers problem, requires that no reader will be kept waiting unless a writer has already obtained permission to use the shared object.The readers-writers problem has several variations, all involving priorities.This synchronization problem is referred to as the readers-writers problem. To ensure that these difficulties do not arise, we require that the writers have exclusive access to the shared database.However, if a writer and some other thread (either a reader or a writer) access the database simultaneously, there could be some synchronization issues. If two readers access the shared data simultaneously, no adverse affects will result.Some of these processes may want only to read the database (readers), whereas others may want to update (that is, to read and write) the database (writers). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |