On Tuesday 01 April 2008 23:57:47 bhanu nani wrote: >Hi guys, > >I was studying on reader-writer semaphores in LLD3. Refered to some >samaphore books. but some clarity is missing. > >Reader/Writer Semaphores: >The critical section between down_read, up_read semaphores provides >read-only access to the protected resources. > >I assume that any data in between thi calls is considered protected resources. >As there is no data manipulation what it means is reader1/ reader2 can >execute the same instrction simultaniously. but how is that possible. >How can a perform a read a read aeithout data manipulation i.e. >updating user buffers, updatinf the fpos, count. Will these not need >protection between the readers themselves i.e. reader1, reader2, >...readerN > >How does this happen? > >Regards, > >Bhanu Dear Bhanu, What you are missing is that, in reading, there is NO manipulation of the data you read. These are what are protected. Buffers, fpos, counters and anything needed to comply are not part of the kernel structure the semaphore is protecting. You talked about "USER buffers...". May be you meant "PROCESS" ones. You forget that any process, in kernel mode, has his working memory: read 'Kernel Stack'. Regards, fabio de francesco -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ