Boost logo

Boost :

From: Hoeffner, Detlef (Detlef.Hoeffner_at_[hidden])
Date: 2002-04-03 09:37:41


> As a substitute, try using the comparison operator for the boost::thread
> class. This can fill the gap in many (but not all) cases where you are
> managing the set of threads yourself.

I need this mainly for tracing purposes in spots where I have no knowledge
of the current instance of thread. This does not seem to help me in that
case.

> On some platforms (i.e. pthreads), the "thread_id" is actually an opaque
> type (pthread_t) rather than a numeric value, and I think that is why no
> such operation is exposed in the current version of the library.

It is however possible to provide a class threadid, that has dependent on
the
platform different members but provides operations as ==, !=,
operator<<(ostream&, ), ... That would be fine to solve the problem.

Regards

Detlef

-----Original Message-----
From: Moore, Dave [mailto:dmoore_at_[hidden]]
Sent: Mittwoch, 3. April 2002 14:33
To: 'boost_at_[hidden]'
Subject: RE: [boost] Thread locals

> -----Original Message-----
> From: Hoeffner, Detlef
> [mailto:Detlef.Hoeffner_at_[hidden]]
> Sent: Wednesday, April 03, 2002 6:59 AM
> To: 'boost_at_[hidden]'
> Subject: [boost] Thread locals
>
>
> Hello all,
>
> I am replacing my thread abstraction with the thread package
> from boost. It
> is very nice but I am missing two things.
>
> The first is the possibility to get an identifier for the
> current thread, a
> thread id.

As a substitute, try using the comparison operator for the boost::thread
class. This can fill the gap in many (but not all) cases where you are
managing the set of threads yourself.

On some platforms (i.e. pthreads), the "thread_id" is actually an opaque
type (pthread_t) rather than a numeric value, and I think that is why no
such operation is exposed in the current version of the library.

Regards,
Dave

_______________________________________________
Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost


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