Synchronization between user space process and interupt context code

Posted by user1748950 on Stack Overflow See other posts from Stack Overflow or by user1748950
Published on 2012-10-16T04:58:28Z Indexed on 2012/10/16 5:01 UTC
Read the original article Hit count: 106

Filed under:
|
|

Recently I attended couple of interviews. Out of all kernel questions which were asked, thr is one specific question which I couldnt find convincing answer of.

How will you use different synchronization techniques while sharing data between user space process and interrupt context function? My convincing answer was:

In interrupt context code: 1. do *spin_lock_irqsave* 2. access data buffer which is shared between user space app and kernel 3. do *spin_lock_irqrestore*

Then this was not convincing answer. Do I have to do irqsave and irqrestore in all the instances of data access?

Regards, Yogi

© Stack Overflow or respective owner

Related posts about linux

Related posts about kernel