lkml.org 
[lkml]   [1999]   [Mar]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: interrupts and synchronization
From
Date
olafm@seas.upenn.edu (Olaf Meyer) writes:

> Is there any way to use synchroniztion methods (e.g. semaphores) in
> interrupts? It seems to me that this is not possible, since you are not
> allowed to invoke the scheduler from interrupts.
>
> I have the following problem: In my protocol handler routine
> for a network device driver I have to check a condition variable.
> If this is not set properly, I have to wait until it changes
> before I proceed with the processing of the package.

IP uses a crude hack to solve a similar problem (socket locking when
user context may possibly sleep with socket locked). When the
socket is locked on an incomming packet the packet is put onto a backlog
queue in the socket, on release_sock() time the backlog queue is checked
and the protocol handler is recalled with a special backlog_rcv method.
This is done in a {start,end}_bh_atomic lock to not violate any netbh
atomicity assumptions.

It is not pretty, but it works.


-Andi

--
This is like TV. I don't like TV.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:50    [W:0.052 / U:0.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site