Re: Help with char device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 27 Jul 2002, Tom Bradley wrote:

> ssize_t my_read(struct file * filp, char * buf, size_t count, loff_t * fpos)
> {
>
> 	ssize_t ret;
> 	struct semaphore sem;

Note that I'm not familiar with the semaphore code, so I could be
wrong ... but won't this effectively give each thread going into
this code its OWN semaphore on its own stack ?

If it does so, the semaphore won't take care of mutual exclusion
between threads.

regards,

Rik
-- 
Bravely reimplemented by the knights who say "NIH".

http://www.surriel.com/		http://distro.conectiva.com/


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux