Re: locking question in the SMP era

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

 



On 9/6/05, Roy Smith <misterdabolina@xxxxxxxxx> wrote:
> I'm mostly concerned about a module which export a read/write proc entity to
> user world,
> but would be most thankful for a general answer.

Are you working on 2.6.x kernel ?? if yes then do use SysFS and not
ProcFS b/c in 2.6.x it is mostly used for process related information
but in 2.4.x kernel you can use it .....

> how should I lock the proc from user access ?
> and more generally: If i can be invoked concurrently on several processors,
> should I lock
> every variable from myself, too ?
>  

if the variables are shared among different processes/threads in your
module then you have to lock them ..... but if the comes from user
space and you just use it in a single function called against the user
program request through procfs or sysfs interface then no need to lock
.....

by the way think in terms of how many processes/threads,
callback-functions and other things (like work queues etc) you are
using b/c they can be run conccurently as I mentioned in the previous
mail ...

or tell what u want to do exactly !!!!



-- 
Fawad Lateef

--
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