[PD] u_thread was: [coll] bug

Dan Wilcox danomatika at gmail.com
Sun Sep 18 20:43:17 CEST 2016


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-request at lists.iem.at wrote:
> 
> From: Alexandre Torres Porres <porres at gmail.com <mailto:porres at gmail.com>>
> Subject: Re: [PD] [coll] bug
> Date: September 18, 2016 at 8:06:16 AM MDT
> To: Ivica Bukvic <ico at vt.edu <mailto:ico at vt.edu>>
> Cc: Pd-list <pd-list at lists.iem.at <mailto:pd-list at lists.iem.at>>
> 
> 
> 2016-09-18 4:43 GMT-03:00 Ivica Bukvic <ico at vt.edu <mailto:ico at 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.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20160918/ef202730/attachment.html>


More information about the Pd-list mailing list