The windows thread api is pretty similar to pthread and I still don’t get why 
many open source projects don’t use a simple wrapper layer to abstract things. 
(I’m not talking about pthreads32 BTW)

Here’s the old ofThread from OpenFrameworks that does exactly that:

* ofThread.h 
<https://github.com/openframeworks/openFrameworks/blob/6e7d325ec6f0046f281498797748da173a84aa7e/libs/openFrameworks/utils/ofThread.h>
* ofThread.cpp 
<https://github.com/openframeworks/openFrameworks/blob/6e7d325ec6f0046f281498797748da173a84aa7e/libs/openFrameworks/utils/ofThread.cpp>

As long as you’re doing the threading basics like running, joining, mutex, & 
semaphores it’s not much code to provide access on both Windows & Unixes. 
Perhaps this is something we could add to the Pure Data source code itself that 
externals could then access. Basically just a layer with the usual callback 
setting mechanism and a per-thread mutex. Maybe something like a “u_thread.c" 
source file...

--------
Dan Wilcox
@danomatika <https://twitter.com/danomatika>
danomatika.com <http://danomatika.com/>
robotcowboy.com <http://robotcowboy.com/>
> On Sep 18, 2016, at 9:51 AM, pd-list-requ...@lists.iem.at wrote:
> 
> From: Alexandre Torres Porres <por...@gmail.com <mailto:por...@gmail.com>>
> Subject: Re: [PD] [coll] bug
> Date: September 18, 2016 at 8:06:16 AM MDT
> To: Ivica Bukvic <i...@vt.edu <mailto:i...@vt.edu>>
> Cc: Pd-list <pd-list@lists.iem.at <mailto:pd-list@lists.iem.at>>
> 
> 
> 2016-09-18 4:43 GMT-03:00 Ivica Bukvic <i...@vt.edu <mailto:i...@vt.edu>>:
> Instead of outright removing the feature for all platforms when it works on 2 
> out of 3 them, you could disable building it on Windows as it is very much 
> useful on other platforms that support POSIX threads. 
> 
> In practice it still has it for the other platforms, cause deken still 
> carries the previous packages. I agree though that it'd be better to just 
> disable it for windows in the code, cause then the same package version could 
> be updated for all platforms in deken, keeping them in sync with the same 
> build version - and update the help file to say this was removed for the 
> windows version because of a bug.

_______________________________________________
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list

Reply via email to