concurrency, locks, reentrant functions

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

 






Hi,

  I am writing a driver.

    I need to make my functions re-entrant, how do I go about writing my
   functions to make them so ?
    I will have  a hash function there, which maintains a list of
   structures, like the list_head structure(a standard eature of linux
   kernel) is there any such standard thing given even for hash tables ?
   Also, though my system is not SMP, but still if I want to use spinlocks,
   whats the starting point to read and know about them. A user space
   process writes the value of a variable to the driver, and the driver has
   to check this value before doing anything, so I believe this is right
   place for a spinlock right ?, I dont want one part of the driver to read
   this variable while it is being updated. Or, do I not need a spin lock
   because everything would be sequential ? I am not very clear about this.

      Actually my driver would have a char device driver portion and
netfilter hook functions, a user level process would write to the char
device, and the netfilter hook functions wld read this variable to find
whats to be done when they catch packets. So in this scenario would spin
locks be needed ?

thanks
Amit


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