Csound Csound-dev Csound-tekno Search About

[Cs-dev] Opcodes using threads on Windows

Date2010-07-22 13:56
Fromandy fillebrown
Subject[Cs-dev] Opcodes using threads on Windows
I'm looking into an issue in QuteCsound on Windows with the opcodes
fluidSynth.dll, virtual.dll, and widgets.dll.  When any of those three
are loaded and unloaded during Csound initialization and destruction,
it causes the system clipboard to stop working correctly along with
strange and mysterious crashes in QuteCsound after the first Csound
run is finished.  Looking at the code, it appears those opcodes are
the only ones that have anything to do with multithreading, which is
known to cause clipboard problems on Windows when there is a conflict,
so I'm starting there ...

The virtual.dll and widgets.dll opcodes problem is probably an fltk
issue, which makes me wonder if Csound 5.11.1 for Windows was built
with fltk multithreading enabled or not.

Looking at the fluidsynth code, I see an option for building it with
pthreads.  Was this option taken for the Csound 5.11.1 Windows build
using the same pthreads library that the rest of Csound uses? ...or is
there some conflict due to a different threading library being used?

The current workaround for QuteCsound users is to remove the three
offending opcodes from the plugins directory, but this is not obvious
and many people trying QuteCsound on Windows give up on it right away
when it crashes.  Any help figuring this out is much appreciated.

Cheers,
~ andy.f

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2010-07-22 14:38
FromVictor Lazzarini
SubjectRe: [Cs-dev] Opcodes using threads on Windows
I was wondering when the FLTK code would start causing problems on  
Windows.

A few years back, I had an extensively look into problems of FLTK  
multithreading in Csound on OSX. To cut the story short, the way FLTK  
multithreading is implemented in Csound is not recommended and  
unsupported by FLTK. This means that they way Csound calls fl_lock()  
etc is not correct and in fact the FLTK developers told me it was a  
fluke that it worked (on Windows, but never worked on OSX). So on OSX,  
widget opcodes are run single-threaded. I'd suggest the same should be  
used across all platforms.

Victor
On 22 Jul 2010, at 13:56, andy fillebrown wrote:

> I'm looking into an issue in QuteCsound on Windows with the opcodes
> fluidSynth.dll, virtual.dll, and widgets.dll.  When any of those three
> are loaded and unloaded during Csound initialization and destruction,
> it causes the system clipboard to stop working correctly along with
> strange and mysterious crashes in QuteCsound after the first Csound
> run is finished.  Looking at the code, it appears those opcodes are
> the only ones that have anything to do with multithreading, which is
> known to cause clipboard problems on Windows when there is a conflict,
> so I'm starting there ...
>
> The virtual.dll and widgets.dll opcodes problem is probably an fltk
> issue, which makes me wonder if Csound 5.11.1 for Windows was built
> with fltk multithreading enabled or not.


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2010-07-22 14:43
FromMichael Gogins
SubjectRe: [Cs-dev] Opcodes using threads on Windows
FLTK must be, and is, built with threading for use with Csound. As it
states in the csound-build.tex document.

What Victor says is basically correct. I believe it is possible to use
FLTK widgets and to run Csound without FLTK threading at all. I am not
100% sure about this and FLTK threading calls may still be needed in
CsoundVST.

Regards,
Mike

On Thu, Jul 22, 2010 at 9:38 AM, Victor Lazzarini
 wrote:
> I was wondering when the FLTK code would start causing problems on
> Windows.
>
> A few years back, I had an extensively look into problems of FLTK
> multithreading in Csound on OSX. To cut the story short, the way FLTK
> multithreading is implemented in Csound is not recommended and
> unsupported by FLTK. This means that they way Csound calls fl_lock()
> etc is not correct and in fact the FLTK developers told me it was a
> fluke that it worked (on Windows, but never worked on OSX). So on OSX,
> widget opcodes are run single-threaded. I'd suggest the same should be
> used across all platforms.
>
> Victor
> On 22 Jul 2010, at 13:56, andy fillebrown wrote:
>
>> I'm looking into an issue in QuteCsound on Windows with the opcodes
>> fluidSynth.dll, virtual.dll, and widgets.dll.  When any of those three
>> are loaded and unloaded during Csound initialization and destruction,
>> it causes the system clipboard to stop working correctly along with
>> strange and mysterious crashes in QuteCsound after the first Csound
>> run is finished.  Looking at the code, it appears those opcodes are
>> the only ones that have anything to do with multithreading, which is
>> known to cause clipboard problems on Windows when there is a conflict,
>> so I'm starting there ...
>>
>> The virtual.dll and widgets.dll opcodes problem is probably an fltk
>> issue, which makes me wonder if Csound 5.11.1 for Windows was built
>> with fltk multithreading enabled or not.
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>



-- 
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2010-07-22 15:15
Fromandy fillebrown
SubjectRe: [Cs-dev] Opcodes using threads on Windows
Is there any chance the upcoming 5.12 release for Windows can be built
with fltk as single-threaded?  It would be great to get this resolved
before QuteCsound 0.6.0 is released.

Cheers,
~ andy.f



On Thu, Jul 22, 2010 at 9:38 AM, Victor Lazzarini
 wrote:
> I was wondering when the FLTK code would start causing problems on
> Windows.
>
> A few years back, I had an extensively look into problems of FLTK
> multithreading in Csound on OSX. To cut the story short, the way FLTK
> multithreading is implemented in Csound is not recommended and
> unsupported by FLTK. This means that they way Csound calls fl_lock()
> etc is not correct and in fact the FLTK developers told me it was a
> fluke that it worked (on Windows, but never worked on OSX). So on OSX,
> widget opcodes are run single-threaded. I'd suggest the same should be
> used across all platforms.
>
> Victor
> On 22 Jul 2010, at 13:56, andy fillebrown wrote:
>
>> I'm looking into an issue in QuteCsound on Windows with the opcodes
>> fluidSynth.dll, virtual.dll, and widgets.dll.  When any of those three
>> are loaded and unloaded during Csound initialization and destruction,
>> it causes the system clipboard to stop working correctly along with
>> strange and mysterious crashes in QuteCsound after the first Csound
>> run is finished.  Looking at the code, it appears those opcodes are
>> the only ones that have anything to do with multithreading, which is
>> known to cause clipboard problems on Windows when there is a conflict,
>> so I'm starting there ...
>>
>> The virtual.dll and widgets.dll opcodes problem is probably an fltk
>> issue, which makes me wonder if Csound 5.11.1 for Windows was built
>> with fltk multithreading enabled or not.
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2010-07-22 16:51
Fromandy fillebrown
SubjectRe: [Cs-dev] Opcodes using threads on Windows
Does that mean it will stay broken? ...or is it going to be fixed?

~ andy.f



On Thu, Jul 22, 2010 at 9:43 AM, Michael Gogins
 wrote:
> FLTK must be, and is, built with threading for use with Csound. As it
> states in the csound-build.tex document.
>
> What Victor says is basically correct. I believe it is possible to use
> FLTK widgets and to run Csound without FLTK threading at all. I am not
> 100% sure about this and FLTK threading calls may still be needed in
> CsoundVST.
>
> Regards,
> Mike
>
> On Thu, Jul 22, 2010 at 9:38 AM, Victor Lazzarini
>  wrote:
>> I was wondering when the FLTK code would start causing problems on
>> Windows.
>>
>> A few years back, I had an extensively look into problems of FLTK
>> multithreading in Csound on OSX. To cut the story short, the way FLTK
>> multithreading is implemented in Csound is not recommended and
>> unsupported by FLTK. This means that they way Csound calls fl_lock()
>> etc is not correct and in fact the FLTK developers told me it was a
>> fluke that it worked (on Windows, but never worked on OSX). So on OSX,
>> widget opcodes are run single-threaded. I'd suggest the same should be
>> used across all platforms.
>>
>> Victor
>> On 22 Jul 2010, at 13:56, andy fillebrown wrote:
>>
>>> I'm looking into an issue in QuteCsound on Windows with the opcodes
>>> fluidSynth.dll, virtual.dll, and widgets.dll.  When any of those three
>>> are loaded and unloaded during Csound initialization and destruction,
>>> it causes the system clipboard to stop working correctly along with
>>> strange and mysterious crashes in QuteCsound after the first Csound
>>> run is finished.  Looking at the code, it appears those opcodes are
>>> the only ones that have anything to do with multithreading, which is
>>> known to cause clipboard problems on Windows when there is a conflict,
>>> so I'm starting there ...
>>>
>>> The virtual.dll and widgets.dll opcodes problem is probably an fltk
>>> issue, which makes me wonder if Csound 5.11.1 for Windows was built
>>> with fltk multithreading enabled or not.
>>
>>
>> ------------------------------------------------------------------------------
>> This SF.net email is sponsored by Sprint
>> What will you do first with EVO, the first 4G phone?
>> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>
>
>
> --
> Michael Gogins
> Irreducible Productions
> http://www.michael-gogins.com
> Michael dot Gogins at gmail dot com
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2010-07-23 04:58
Fromandy fillebrown
SubjectRe: [Cs-dev] Opcodes using threads on Windows
The -mthreads flag is not being added to CXXFLAGS in SConstruct
(around line 550).  The -mthreads flag is only added to CCFLAGS.
Since fluidOpcodes.cpp is part of fluidsOpcodes.dll, adding -mthreads
to CXXFLAGS will probably fix that particular threading issue.

In lieu of getting a quick fix for the fltk opcodes, can a
--disable-opcode flag be added to the command-line options for the
5.12 Windows release?

Cheers,
~ andy.f



On Thu, Jul 22, 2010 at 8:56 AM, andy fillebrown
 wrote:
> I'm looking into an issue in QuteCsound on Windows with the opcodes
> fluidSynth.dll, virtual.dll, and widgets.dll.  When any of those three
> are loaded and unloaded during Csound initialization and destruction,
> it causes the system clipboard to stop working correctly along with
> strange and mysterious crashes in QuteCsound after the first Csound
> run is finished.  Looking at the code, it appears those opcodes are
> the only ones that have anything to do with multithreading, which is
> known to cause clipboard problems on Windows when there is a conflict,
> so I'm starting there ...
>
> The virtual.dll and widgets.dll opcodes problem is probably an fltk
> issue, which makes me wonder if Csound 5.11.1 for Windows was built
> with fltk multithreading enabled or not.
>
> Looking at the fluidsynth code, I see an option for building it with
> pthreads.  Was this option taken for the Csound 5.11.1 Windows build
> using the same pthreads library that the rest of Csound uses? ...or is
> there some conflict due to a different threading library being used?
>
> The current workaround for QuteCsound users is to remove the three
> offending opcodes from the plugins directory, but this is not obvious
> and many people trying QuteCsound on Windows give up on it right away
> when it crashes.  Any help figuring this out is much appreciated.
>
> Cheers,
> ~ andy.f
>

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net