Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-06-20 07:06:42


1.

explicit thread::thread(const boost::function0<void>& threadfunc);

Shouldn't this be

template<class F> explicit thread::thread(F threadfunc);

As it is, implementors are forced to roll their own function0<void>. (How
does CoreX deal with this?)

2.

Has it been pointed out that the current mutex/scoped_lock model is
equivalent in expressive power to a mutex with public lock/unlock methods?

class my_mutex
{
    mutex m;
    mutex::scoped_lock l;

public:

    my_mutex(): l(m, false) {}

    void lock() { l.lock(); }
    void unlock() { l.unlock(); }
};

3. Speaking of template<class F>, are there plans to extend boost::once to
accept function objects?

template<class F> void once(F f, once_flag & flag);

Minor documentation details (once.html): 'implementation defined' should be
'unspecified'; the Effects/Posconditions imply that once_flag is equality
comparable, is this intentional?

4. Are there plans to supply a statically initialized mutex, to avoid init
order problems?

(BTW, 3 can be implemented given 4, and vice versa, but neither can be
implemented efficiently on top of the current architecture AFAICS.)

5. Are there plans to integrate detail::lightweight_mutex with
boost.threads?

--
Peter Dimov
http://www.mmltd.net/pdimov

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