Boost logo

Boost :

From: Lie-Quan Lee (llee1_at_[hidden])
Date: 2001-04-03 10:31:16


At Tue, 03 Apr 2001 14:04:28 -0000,
William Kempf wrote:
> Including a try_lock for all of these types is problematic on Win32.
> Not all Win32 platforms support a try_lock concept using critical
> sections, and using a Mutex instead leads to performance degradation
> on the scale of the pthread implementation that sparked this debate
> off. (Though I've recently been pointed at a site that maintains
> critical sections can cause worse performance than Mutexes when lock
> contention is high. For many uses, however, the faster critical
> section is still the right answer.)
>
> There's also a problem with explicitly requiring unchecked semantics
> for pthreads. Many pthread implementations don't have an unchecked
> locking semantic. For instance, for pthread-win32 all mutex types
> are recursive, like it or not. Documentation I've read for pthreads
> indicates that there are implementations that supply checked
> variations only, though I couldn't venture to guess what
> implementations do this. For portability + efficiency the best you
> can do is included checked and _unspecified_ locking policies.

I guess that pthreads implementations in most of unix flavor OS ( I
checked four OS's, IRIX64-6.5, Solaris-2.7 and Linux-2.2.x ix86/alpha)
provided unchecked locking semantics. I donot know if Windows native
threads supported unchecked locking semantics or not.

In my mind, Boost is always to get a balance between benefiting most
users and not punishing users who have standard featuers. For example,
Some workaround for VC++(benefiting most users), using partial
specialization if supported(not punishing users). However, the former
is a kind of encouragement of staying in a legacy status from another
point of view. (I am not saying that it is bad to provide workaround,
after all, a portion of users get benefits from that.) Does a legacy
system should deserve a little inconvenience (or punishment) in some
degree so that it will evolve to the better? Should systems which
have a feature be punished because a few other legacy systems lack a
feature?

Cheers,

--
Lie-Quan Lee

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk