Skip to contentSkip to conversation

generic sleeping locks?

DISCUSSION Eli Carter 3 participants 5 messages Dec 18, 2000 – Dec 19, 2000

lore
Share & tools
lore

Eli Carter

author
#0 lore raw

Allow me to display my ignorance a moment.

Are there blocking lock primitives already defined somewhere in the kernel?

It just seems that

while( lockvar )

	sleep_on( &lockwaitq );

along with its various permutations would be commonly used and worthy of being made into a generic sleep lock. A few blind greps through the source didn't find anything that caught my eye.

If there aren't, would a patch to add them be of interest to anyone? Input on design details welcome.

TIA,

Eli
--------------------. "To the systems programmer, users and applications
Eli Carter | serve only to provide a test load."
[email protected] `---------------------------------- (random fortune) -
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#1 lore raw
Quoted 2 lines

Are there blocking lock primitives already defined somewhere in the kernel?

down and up are normally appropriate for this

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

author
#2 lore raw
Quoted 5 lines · Alan Cox
Quoted 3 lines

Are there blocking lock primitives already defined somewhere in the kernel?

down and up are normally appropriate for this

Ungh. Forest. Trees. *sigh* Sorry for the dumb question. Thanks for the reply Alan. :)

Ok, second part of the question: What about blocking read/write locks (with _interruptible variants)?

TIA,

Eli
--------------------. "To the systems programmer, users and applications
Eli Carter | serve only to provide a test load."
[email protected] `---------------------------------- (random fortune) -
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#3 lore raw

In message <[email protected]> you write:

Quoted 5 lines
Quoted 4 lines · Alan Cox
Quoted 3 lines

Are there blocking lock primitives already defined somewhere in the kernel?

Quoted 7 lines
Quoted 1 line

down and up are normally appropriate for this

Ungh. Forest. Trees. *sigh* Sorry for the dumb question. Thanks for the reply Alan. :)

Ok, second part of the question: What about blocking read/write locks (with _interruptible variants)?

Documentation/DocBook/kernel-locking*

Rusty.
--
Hacking time.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

author
#4 lore raw
Quoted 12 lines · Rusty Russell

In message <[email protected]> you write:

Quoted 10 lines
Quoted 5 lines · Alan Cox
Quoted 3 lines

Are there blocking lock primitives already defined somewhere in the kernel?

down and up are normally appropriate for this

Ungh. Forest. Trees. *sigh* Sorry for the dumb question. Thanks for the reply Alan. :)

Quoted 8 lines
Quoted 2 lines

Ok, second part of the question: What about blocking read/write locks (with _interruptible variants)?

Documentation/DocBook/kernel-locking*

Rusty.
--
Hacking time.

Perhaps I should have specified that I'm working with 2.2.xy.... I'll d/l a 2.4.0-test and look at the docbook in that. Thanks for the pointer.

Eli
--------------------. "To the systems programmer, users and applications
Eli Carter | serve only to provide a test load."
[email protected] `---------------------------------- (random fortune) -
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/