Boost logo

Boost :

From: Joe Gottman (joegottman_at_[hidden])
Date: 2000-08-02 20:11:14


----- Original Message -----
From: Valentin Bonnard <Bonnard.V_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Wednesday, August 02, 2000 12:34 PM
Subject: Re: [boost] Threads

> Joe Gottman wrote:
>
> > Since threads, mutexes, etc. are very dependent on the local
architecture
> > for their implementation, I think it would be a good idea to define a
basic,
> > minimal interface for each, similar to the iterator interface used in
the
> > STL. This would allow users to write portable template classes and
> > functions parameterized on the thread, lock or whatever.
>
> What makes you think that people will want to mix different
> thread library implementation in the same program ? It seems
> at first very difficult to do.
>

   I don't think people want to do this. I think library writers want to be
able to write code that uses threads without knowing what thread
implementation a given client will use. Since the client should know at
compile time what thread implementation he will use, if the library writer
can write a template class that takes a Thread class as one of its template
parameters then the client can instantiate the template with whatever kind
of threads work on his machine. This only works, however, if there is some
common interface that the template writer can assume is used by any
implementation.

   Look at the various STL algorithms. The reason they work is because all
STL iterators have certain common functions, like ++it to increment and *it
to dereference.

Joe Gottman


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