From: Victor Lazzarini ()
Date: Dec 2, 2004
Subject:
pthreads (was Re: Updates to csound4)
This raises a question: since pthreads are present on all our target systems,
shouldn't we move towards a more platform-independent code?
I know that, for windows we would require (if you're not on cygwin) the
pthread library. But that's OK, since we are already depending on other
external libraries.
That's probably simplify the code, less #ifdefs.
Perhaps also provide a more uniform behaviour (well, in theory, at least).
I have been using the pthread lib with msvc apps, and it seems to behave very
well, the same way as in unix, so I'd say it's stable enough.
Victor
At 22:53 01/12/2004, you wrote: [EMAIL REMOVED] writes:
>
> > One could use, or not use, pthreads with either MinGW or Cygwin. In
> > my projects (e.g. Csound 5) I don't use Cygwin, I use MinGW, and
> > with MinGW, I do not use pthreads.
>
>I found out why you don't use pthreads on MinGW--the library is not
>present in the current distribution!
>
>I changed csound/widget.cpp as follows, built Csound GBS on MinGW, and
>verified that Art's FL opcode example works.
>
>--- csound/widgets.cpp 1 Dec 2004 13:52:14 -0000 1.14
>+++ csound/widgets.cpp 1 Dec 2004 22:44:53 -0000 [EMAIL REMOVED] -1751,7 [EMAIL REMOVED] >
> extern "C" void FL_run(FLRUN *p)
> {
>-#ifdef _WINDOWS
>+#if defined(_WINDOWS) || defined(WIN32)
> threadHandle = _beginthread(fltkRun, 0, NULL);
> if (isActivatedKeyb)
> threadHandle = _beginthread(fltkKeybRun, 0, NULL);
>
>Please tell if the reference to WIN32 is correct. Michael and others,
>it's so nice having people who have been there giving advice, thus
>making resolving this bug quick. Thanks.
>
>John
>-- [EMAIL REMOVED] > (or to http://www.cs.bath.ac.uk/cgi-bin/csound ) [EMAIL REMOVED]
Victor Lazzarini
Music Technology Laboratory
Music Department
National University of Ireland, Maynooth
-- [EMAIL REMOVED] (or to http://www.cs.bath.ac.uk/cgi-bin/csound ) [EMAIL REMOVED]