|
Threads-Devel : |
From: Roland Schwarz (roland.schwarz_at_[hidden])
Date: 2006-03-12 09:04:48
Today I found a little time to prepare for start of the tss rewrite on
windows.
During the attempt to catch up the thread_rewrite branch, to find
out how we are going on windows I found the following:
1) It seems like Anthony is trying to aim for a header only implementation
on windows. Is my impression true? If so, I would like to learn the
reasons
for it. I believe header only should be avoided as much as possible,
and only
be used when linking is not feasible.
2) TSS cannot be implemented header only. So even if there is an agreement
for it, it could not be done (on windows).
3) I cannot see the founding blocks we discussed for splitting the
thread library
into platform dependant code. All I found is that in the hpp files
the windows
part is #ifedef'fed to win32 specific includes leaving behind old
(commented out) code fragments still belonging to windows.
4) The cpp files altough empty (in the windows case) are still
beeing compiled. Do we really want such an architecture?
Can we possibly go along the lines:
E.g.:
mutex.hpp
===
#if defined(BOOST_HAS_WINTHREADS)
#include "win/mutex.hpp"
#elif defined (BOOST_HAS_MPTASKS)
#include "mpt/mutex.hpp"
#elif defined (BOOST_HAS_PTHREADS)
#include "pthreads/mutex.hpp"
#else
#include "default/mutex.hpp"
#endif
====
where default might be the single threaded case or issue a compiler
error.
And for the cpp files in a similar fashion:
mutex.cpp
===
#if defined(BOOST_HAS_WINTHREADS)
#include "win/mutex.cpp"
#elif defined (BOOST_HAS_MPTASKS)
#include "mpt/mutex.cpp"
#elif defined (BOOST_HAS_PTHREADS)
#include "pthreads/mutex.cpp"
#else
#include "default/mutex.cpp"
#endif
====
Altough I am a little afraid that it might be hard to get the include
path straight for the cpp files since they are not in the main boost
include path but in the src path.
I would alos like to hear what Matt has to say about this for the linux
case.
Btw.: Do we have anyone for the MPTASKS? I believe it is mac os, is it?
What do you think?
Roland