Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Problems when doing multi-threading #585

Closed
sletz opened this issue Aug 4, 2021 · 2 comments
Closed

Problems when doing multi-threading #585

sletz opened this issue Aug 4, 2021 · 2 comments

Comments

@sletz
Copy link

sletz commented Aug 4, 2021

I'm trying to use PortAudio.jl in an application where the running audio code control parameters have to be updated in real-time with a GTK based GUI.

The PA template code is here: https:/grame-cncm/faust/blob/master-dev/architecture/julia/audio/portaudio.jl

The GTK Controller code is here: https:/grame-cncm/faust/blob/master-dev/architecture/julia/gui/GTKUI.jl

I need to start the GTKUI code, make it do not block the calling thread, and have the PortAudio audio rendering code start later on.

I tris using Threads.@spawn without success: the GTK windows does not show correctly and cannot be used. Any idea?

@tknopp
Copy link
Collaborator

tknopp commented Aug 5, 2021

Its not really clear to me, what you are doing. Do you run Julia in interactive mode or in non-interactive mode?

What works:

  • start Julia in interactive mode and run it with two threads.
  • run the worker thread using @tspawnat 2 from https:/tro3/ThreadPools.jl. Usually one will spawn the thread in a callback.

@sletz
Copy link
Author

sletz commented Aug 5, 2021

More to less working now, thanks.

@sletz sletz closed this as completed Aug 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants