The difference is "shared," not "threading."
With the (slight; and possibly implied) modification of s/"shared"/threads::shared/, we agree.
Though I disagree with "any sort of locking requirement would knock that advantage almost completely out".
Mutual exclusion to prevent concurrent access can be achieved far more cheaply than it is currently implemented in Perl. Sufficiently cheaply in the no-contention case, to allow locking to be almost costless for low-but-not-zero contention algorithms.
Indeed, in my experiments with lock-free and wait-free algorithms, I've found that "locking" algorithms can be more efficient than either, for many applications, where: a) the no-contention branch avoids dips into the kernel; b) the contend branch spins a little before deciding it needs to wait (and therefore dips into hte kernel).
Of course, that doesn't work so well for long-term locks, but that is an architectural problem rather than a fundamental algorithmic one.
In reply to Re^4: Thread sharing a bit vector??
by BrowserUk
in thread Thread sharing a bit vector??
by traceyfreitas
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |