I am writting a driver for card in Linux-2.4.20. In this I have a shared linked list of transactions. This list is shared between timer interrupt handler, device interrupt handler and system call. I have a uniprocessor system. How do I ensure mutual exclusion on this shared linked list.
I followed approach.... In system call I do following, local_bh_disable () ; Operate on linked list () ; local_bh_enable () ;
In the bottom half of device interrupt, I directly operate on linked list (without any locking) as this bottom half can not be interrupted by timer interrupt.
In the timer interrupt handler, I directly operate on linked list (without any locking) as this handler can not be interrupted by device interrupt bottom half.
Is this approach right or wrong? Please suggest me correct approach.
Thans and regards, Dinesh
___________________________________________________
Download the hottest & happening ringtones here!
OR SMS: Top tone to 7333
Click here now: http://sms.rediff.com/cgi-bin/ringtone/ringhome.pl
-- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/