Quantcast

[Csnd-dev] Making Pthreads optional

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Csnd-dev] Making Pthreads optional

Steven Yi
Hi All,

I was emailing with Stephen Kyne about MSVC and I mentioned that we
should work on removing pthread as a requirement first before the rest
of the MSVC stuff.  To that end, I've made a no-pthread branch and
pushed that to github.  So far, it's only got a change to CMake that
makes pthreads only required when not on Windows.

The goal is to restore the older Csound thread functions that use
native Windows API calls.  I found a version of these functions going
back to Csound 5.07:

https://github.com/csound/csound/blob/csound5.07/Top/threads.c

The rationale for this work is:

1. On Windows, using pthreads complicates the build and requires we do
static linking of pthreads and everything else that we can link. The
pthreads dependency has been worked around by this static linking in
building with mingw, but it causes issues when trying to build with
CMake and Visual Studio.  Restoring the Windows thread wrappers should
mitigate all of these.

2. The no-op version of the threads functions would be useful for
non-threaded builds.  This would target Emscripten as well as Bela.
As it is today, the work to get the Emscripten build required some
platform-specific #ifdefs and other changes that are a bit untidy, and
making a non-thread build would be a more generic solution.


The plan is to get the no-pthread build working, double-check it works
on other platforms, then merge back into develop once complete.

Thanks!
steven
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd-dev] Making Pthreads optional

Steven Yi
BTW: in terms of work to do, I think the codebase is not too far off.
Restoring the functions in threads.c is one step, the other is
removing references to pthread.h from the code base outside of
threads.c.  The changes are mostly going to be in the header files in
include/ and H/.

On Thu, Feb 23, 2017 at 12:56 PM, Steven Yi <[hidden email]> wrote:

> Hi All,
>
> I was emailing with Stephen Kyne about MSVC and I mentioned that we
> should work on removing pthread as a requirement first before the rest
> of the MSVC stuff.  To that end, I've made a no-pthread branch and
> pushed that to github.  So far, it's only got a change to CMake that
> makes pthreads only required when not on Windows.
>
> The goal is to restore the older Csound thread functions that use
> native Windows API calls.  I found a version of these functions going
> back to Csound 5.07:
>
> https://github.com/csound/csound/blob/csound5.07/Top/threads.c
>
> The rationale for this work is:
>
> 1. On Windows, using pthreads complicates the build and requires we do
> static linking of pthreads and everything else that we can link. The
> pthreads dependency has been worked around by this static linking in
> building with mingw, but it causes issues when trying to build with
> CMake and Visual Studio.  Restoring the Windows thread wrappers should
> mitigate all of these.
>
> 2. The no-op version of the threads functions would be useful for
> non-threaded builds.  This would target Emscripten as well as Bela.
> As it is today, the work to get the Emscripten build required some
> platform-specific #ifdefs and other changes that are a bit untidy, and
> making a non-thread build would be a more generic solution.
>
>
> The plan is to get the no-pthread build working, double-check it works
> on other platforms, then merge back into develop once complete.
>
> Thanks!
> steven
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd-dev] Making Pthreads optional

rorywalsh
Thanks for the update Steven. Is the new branch on github building already with Visual Studio?  

On 23 February 2017 at 17:58, Steven Yi <[hidden email]> wrote:
BTW: in terms of work to do, I think the codebase is not too far off.
Restoring the functions in threads.c is one step, the other is
removing references to pthread.h from the code base outside of
threads.c.  The changes are mostly going to be in the header files in
include/ and H/.

On Thu, Feb 23, 2017 at 12:56 PM, Steven Yi <[hidden email]> wrote:
> Hi All,
>
> I was emailing with Stephen Kyne about MSVC and I mentioned that we
> should work on removing pthread as a requirement first before the rest
> of the MSVC stuff.  To that end, I've made a no-pthread branch and
> pushed that to github.  So far, it's only got a change to CMake that
> makes pthreads only required when not on Windows.
>
> The goal is to restore the older Csound thread functions that use
> native Windows API calls.  I found a version of these functions going
> back to Csound 5.07:
>
> https://github.com/csound/csound/blob/csound5.07/Top/threads.c
>
> The rationale for this work is:
>
> 1. On Windows, using pthreads complicates the build and requires we do
> static linking of pthreads and everything else that we can link. The
> pthreads dependency has been worked around by this static linking in
> building with mingw, but it causes issues when trying to build with
> CMake and Visual Studio.  Restoring the Windows thread wrappers should
> mitigate all of these.
>
> 2. The no-op version of the threads functions would be useful for
> non-threaded builds.  This would target Emscripten as well as Bela.
> As it is today, the work to get the Emscripten build required some
> platform-specific #ifdefs and other changes that are a bit untidy, and
> making a non-thread build would be a more generic solution.
>
>
> The plan is to get the no-pthread build working, double-check it works
> on other platforms, then merge back into develop once complete.
>
> Thanks!
> steven

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd-dev] Making Pthreads optional

Steven Yi
No, the pthread work comes first, then the VS work.  It's simpler
going this route, IMO.

On Thu, Feb 23, 2017 at 2:08 PM, Rory Walsh <[hidden email]> wrote:

> Thanks for the update Steven. Is the new branch on github building already
> with Visual Studio?
>
> On 23 February 2017 at 17:58, Steven Yi <[hidden email]> wrote:
>>
>> BTW: in terms of work to do, I think the codebase is not too far off.
>> Restoring the functions in threads.c is one step, the other is
>> removing references to pthread.h from the code base outside of
>> threads.c.  The changes are mostly going to be in the header files in
>> include/ and H/.
>>
>> On Thu, Feb 23, 2017 at 12:56 PM, Steven Yi <[hidden email]> wrote:
>> > Hi All,
>> >
>> > I was emailing with Stephen Kyne about MSVC and I mentioned that we
>> > should work on removing pthread as a requirement first before the rest
>> > of the MSVC stuff.  To that end, I've made a no-pthread branch and
>> > pushed that to github.  So far, it's only got a change to CMake that
>> > makes pthreads only required when not on Windows.
>> >
>> > The goal is to restore the older Csound thread functions that use
>> > native Windows API calls.  I found a version of these functions going
>> > back to Csound 5.07:
>> >
>> > https://github.com/csound/csound/blob/csound5.07/Top/threads.c
>> >
>> > The rationale for this work is:
>> >
>> > 1. On Windows, using pthreads complicates the build and requires we do
>> > static linking of pthreads and everything else that we can link. The
>> > pthreads dependency has been worked around by this static linking in
>> > building with mingw, but it causes issues when trying to build with
>> > CMake and Visual Studio.  Restoring the Windows thread wrappers should
>> > mitigate all of these.
>> >
>> > 2. The no-op version of the threads functions would be useful for
>> > non-threaded builds.  This would target Emscripten as well as Bela.
>> > As it is today, the work to get the Emscripten build required some
>> > platform-specific #ifdefs and other changes that are a bit untidy, and
>> > making a non-thread build would be a more generic solution.
>> >
>> >
>> > The plan is to get the no-pthread build working, double-check it works
>> > on other platforms, then merge back into develop once complete.
>> >
>> > Thanks!
>> > steven
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd-dev] Making Pthreads optional

rorywalsh
You won't hear me complaining ;) 

On 23 February 2017 at 19:30, Steven Yi <[hidden email]> wrote:
No, the pthread work comes first, then the VS work.  It's simpler
going this route, IMO.

On Thu, Feb 23, 2017 at 2:08 PM, Rory Walsh <[hidden email]> wrote:
> Thanks for the update Steven. Is the new branch on github building already
> with Visual Studio?
>
> On 23 February 2017 at 17:58, Steven Yi <[hidden email]> wrote:
>>
>> BTW: in terms of work to do, I think the codebase is not too far off.
>> Restoring the functions in threads.c is one step, the other is
>> removing references to pthread.h from the code base outside of
>> threads.c.  The changes are mostly going to be in the header files in
>> include/ and H/.
>>
>> On Thu, Feb 23, 2017 at 12:56 PM, Steven Yi <[hidden email]> wrote:
>> > Hi All,
>> >
>> > I was emailing with Stephen Kyne about MSVC and I mentioned that we
>> > should work on removing pthread as a requirement first before the rest
>> > of the MSVC stuff.  To that end, I've made a no-pthread branch and
>> > pushed that to github.  So far, it's only got a change to CMake that
>> > makes pthreads only required when not on Windows.
>> >
>> > The goal is to restore the older Csound thread functions that use
>> > native Windows API calls.  I found a version of these functions going
>> > back to Csound 5.07:
>> >
>> > https://github.com/csound/csound/blob/csound5.07/Top/threads.c
>> >
>> > The rationale for this work is:
>> >
>> > 1. On Windows, using pthreads complicates the build and requires we do
>> > static linking of pthreads and everything else that we can link. The
>> > pthreads dependency has been worked around by this static linking in
>> > building with mingw, but it causes issues when trying to build with
>> > CMake and Visual Studio.  Restoring the Windows thread wrappers should
>> > mitigate all of these.
>> >
>> > 2. The no-op version of the threads functions would be useful for
>> > non-threaded builds.  This would target Emscripten as well as Bela.
>> > As it is today, the work to get the Emscripten build required some
>> > platform-specific #ifdefs and other changes that are a bit untidy, and
>> > making a non-thread build would be a more generic solution.
>> >
>> >
>> > The plan is to get the no-pthread build working, double-check it works
>> > on other platforms, then merge back into develop once complete.
>> >
>> > Thanks!
>> > steven
>
>

Loading...