Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista Drivers > Synchronise resource b/w interrupt routine & sys thread at PASSIVE

Reply
Thread Tools Display Modes

Synchronise resource b/w interrupt routine & sys thread at PASSIVE

 
 
Mohit Gupta
Guest
Posts: n/a

 
      06-18-2010
I have a dedicated memory (non-paged memory) which is used by interrupt
routines to write data and PASSIVE_LEVEL system thread to read data from

Now I want to synchronise read and writes. Can you please advise how can I
achieve that in Multiple processor (MP) system
 
Reply With Quote
 
 
 
 
Pavel A.
Guest
Posts: n/a

 
      06-18-2010
Synchronization works on the highest level of all players.
So, if one of them runs at DIRQL, you've got to use
KeAcquireInterruptSpinLock or KeSynchronizeExecution.

Regards,
-- pa

"Mohit Gupta" <> wrote in message
news:CEA577E1-E507-485E-BACE-...
> I have a dedicated memory (non-paged memory) which is used by interrupt
> routines to write data and PASSIVE_LEVEL system thread to read data from
>
> Now I want to synchronise read and writes. Can you please advise how can I
> achieve that in Multiple processor (MP) system


 
Reply With Quote
 
Simon Richter
Guest
Posts: n/a

 
      06-18-2010
Hi,

On 2010年06月18日 09:17, Mohit Gupta wrote:

> I have a dedicated memory (non-paged memory) which is used by interrupt
> routines to write data and PASSIVE_LEVEL system thread to read data from


> Now I want to synchronise read and writes. Can you please advise how can I
> achieve that in Multiple processor (MP) system


From your other post, I gather that you have a
single-writer-single-reader use case. In that case, I'd advise to use a
ring buffer for transporting the actual data, and a notification
mechanism by which the writer can wake up the reader when data is available.

The ring buffer can be accessed without locks, as each thread will only
increase one of the pointers, and read the other; loss of
synchronisation here is not harmful as long as the notification
mechanism makes sure that the updated "write pointer" is visible to the
reader when it is woken up, so it does not go back to sleep before it
sees the update.

You will need to take care that the pointers are suitably aligned that
they can be atomically read from and written to.

You will lose events when the buffer is full, but this cannot be
avoided, as the interrupt handler cannot allocate memory.

Simon

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
2003r2 - Moving ressources to a new hardware and storage Adrien Maugard Clustering 2 01-08-2010 10:39 AM
WDF Interrupt Issue Murugesan Windows Vista Drivers 6 11-23-2009 05:19 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59