Boost logo

Boost Users :

From: William E. Kempf (wekempf_at_[hidden])
Date: 2003-05-13 09:08:33


Ben Hutchings said:
> Mark Sizer wrote:
>> I know there was a discussion about the need for these and why
>> they're not in the library. I can't find it, however.
>>
>> I'm having the same problem the original poster had: I'm using
>> the thread ID as an identifier in a data structure (std::map in this
>> case).
>
> You can do that with Windows thread IDs, because they are simple
> integers. Unfortunately the Posix thread ID type (pthread_t) is
> an abstract data type and the only relation defined on it is
> equality (pthread_equal()). Some implementations use a type that
> can safely and correctly be compared with std::less, but there's
> no guarantee of that, so Boost can't offer such a guarantee
> either.

Actually, we can, and do in the thread_dev branch. It means that the ID
is of implementation defined type, but it's portable.

-- 
William E. Kempf

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net