Re: [LIP] Question about Linux kernel
"Sridhar R" <[email protected]>
| Newsgroups | gmane.user-groups.linux.india.programmers |
|---|---|
| Message-ID | <[email protected]> |
Linux-2.6 _is_ pre-emptive (if configured so). Robert Love's 'Linux Kernel Development' convers 2.6 kernel -- it's a good book. Rakesh Avichal Ughreja said: > Is Linux kernel pre-emptive ? > > I have a question about Linux kernel. I am writing a char driver, in which > I > have implemented my own queues for reader and writer. I don't know if such > queues are already available in Linux. > > Whenever my driver receives interrupt from device, it gets the packet from > devices memory and enqueues into the Rx queue. > > In the device_read call, i want to dequeue packet from this queue and want > to send it to user using copy_to_user. > > How do I take care of mutual exclusion here ? One obvious thing is > whenever > ISR is getting executed I am sure its an atomic operation and my reader > process will not get chance to run, but I don't know what will happen if > an > interrupt comes while reader is dequeueing the packet from the queue. > > How can I make enqueue and dequeue functions atomic ? > > Thanks in advance. > > Regards, > Rakesh > > ----------------------------------------------------------- > "Behind every successful woman, is a man who is surprised." > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle 10g. > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click > _______________________________________________ > linux-india-programmers mailing list > linux-india-programmers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org > https://lists.sourceforge.net/lists/listinfo/linux-india-programmers > /----------------------------------------------| | R. Sridhar | | WWW: http://cs.annauniv.edu/~rsridhar | |----------------------------------------------/ ------------------------------------------------------- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click