Hi,
I'd like to know what is the best recommended way to support
multi-threading in LyX, as of now. I thought using Qt (i.e., QThread &
related) is the most straightforward thing, as we already depend on Qt.
However, I noticed the m4/lock.m4 configure options such as
"--enable-threads":
--enable-threads={posix|solaris|pth|win32}
specify multithreading API
--disable-threads build without multithread safety
and the accordingly defined MACROs [1]. So, I don't understand whether
one should rely at all on any of these macros, as they would seem to be
platform-specific and non-portable. For example, I'd be tempted to use
pthreads, but what would happen on Windows ?
On a related note, what is the rationale of this line in configure.ac
#define BOOST_DISABLE_THREADS 1
?
Also, is there any of these or related configure options by which the
user says whether he/she wants a multi-threaded or single-threaded LyX
program ? (e.g., --disable-threads would seem to be exactly what I'd
need, but I'm not really sure). If yes, what would be the corresponding
#ifdef to put into .cpp code ? Here I'm in trouble, as the only thing
that I can see is something like
#if USE_POSIX_THREADS || USE_SOLARIS_THREADS || USE_PTH_THREADS ||
USE_WIN32_THREADS
which doesn't seem to be really usable.
Thanks,
Tommaso
[1] $ grep DEFINE m4/lock.m4
AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], 1,
AC_DEFINE([USE_POSIX_THREADS], 1,
AC_DEFINE([USE_POSIX_THREADS_WEAK], 1,
[AC_DEFINE([HAVE_PTHREAD_RWLOCK], 1,
[AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], 1,
AC_DEFINE([USE_SOLARIS_THREADS], 1,
AC_DEFINE([USE_SOLARIS_THREADS_WEAK], 1,
AC_DEFINE([USE_PTH_THREADS], 1,
AC_DEFINE([USE_PTH_THREADS_WEAK], 1,
AC_DEFINE([USE_WIN32_THREADS], 1,