About Locks..
(too old to reply)
2019-12-02 21:31:54 UTC

About Locks..

I have just read the following article that appeared in C/C++ Users
Journal, 23(3), March 2005

The Trouble With Locks


But i don't agree with him about composability of lock-based systems,
read the following to understand:

About composability of lock-based systems now:

Design your systems to be composable. Among the more galling claims of
the detractors of lock-based systems is the notion that they are somehow

“Locks and condition variables do not support modular programming,”
reads one typically brazen claim, “building large programs by gluing
together smaller programs[:] locks make this impossible.”9 The claim, of
course, is incorrect. For evidence one need only point at the
composition of lock-based systems such as databases and operating
systems into larger systems that remain entirely unaware of lower-level

There are two ways to make lock-based systems completely composable, and
each has its own place. First (and most obviously), one can make locking
entirely internal to the subsystem. For example, in concurrent operating
systems, control never returns to user level with in-kernel locks held;
the locks used to implement the system itself are entirely behind the
system call interface that constitutes the interface to the system. More
generally, this model can work whenever a crisp interface exists between
software components: as long as control flow is never returned to the
caller with locks held, the subsystem will remain composable.

Second (and perhaps counterintuitively), one can achieve concurrency and
composability by having no locks whatsoever. In this case, there must be
no global subsystem state—subsystem state must be captured in
per-instance state, and it must be up to consumers of the subsystem to
assure that they do not access their instance in parallel. By leaving
locking up to the client of the subsystem, the subsystem itself can be
used concurrently by different subsystems and in different contexts. A
concrete example of this is the AVL tree implementation used extensively
in the Solaris kernel. As with any balanced binary tree, the
implementation is sufficiently complex to merit componentization, but by
not having any global state, the implementation may be used concurrently
by disjoint subsystems—the only constraint is that manipulation of a
single AVL tree instance must be serialized.

Read more here:


Thank you,
Amine Moulat Ramdane.
2019-12-02 22:17:18 UTC
Post by Wisdom90
You've got about as much wisdom as my foreskin.
The Peeler
2019-12-02 22:32:57 UTC
On Mon, 2 Dec 2019 14:17:18 -0800 (PST), Zaire, better known as "Moose in
Love with Nazi Scum" spread yet more of its stench:

<FLUSH the disgusting nazi hypocrite's latest hypocritical nazi bullshit
unread again>

What are you doing in sci, you disgusting nazi hypocrite?
Hitler admirer Moose in Love with Nazi Scum exposing his hypocrisy again:
"The people doing the murdering, raping and expelling are the ones guilty of
crimes. Not Hitler you moron."
Message-ID: <ddafe705-4653-4f33-a7fc-***@googlegroups.com>