-
Notifications
You must be signed in to change notification settings - Fork 732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NRT thread can block disk I/O thread #5511
Comments
This lock was added, I think, to make sure the disk io ugens worked in NRT mode.
/*
Josh Parmenter
www.realizedsound.net/josh
*/
… On Jul 17, 2021, at 16:12, Christof Ressi ***@***.***> wrote:
The disk I/O thread in DiskIO_UGens.cpp locks the NRT thread when it wants to write data from the buffer to the disk. AFAICT, this is only necessary because the user might accidentally free the buffer concurrently (which shouldn't really happen).
I understand that (ab)using Server sound buffers for disk I/O is convenient because it already handles the opening and closing of soundfiles. However, it also means the disk I/O thread is implicitly tied to the NRT thread, which kind of defeats the whole purpose of having a dedicated disk I/O thread in the first place...
Note that asynchronous commands executed on the NRT thread can take an arbitrary amount of time!
This causes problems such as this: https://git.iem.at/pd/vstplugin/-/issues/58
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
No, BTW, I find it strange that |
I'm surprised. I've used DiskOut a LOT for large NRT files without any problems. Regardless - if you propose any changes, please make sure reading and writing for those UGens in NRT still works. Thanks! |
That's interesting to know! In practice it's not a problem if the buffer is sufficiently big, but it's definitely not safe.
Sure, good point! |
The disk I/O thread in
DiskIO_UGens.cpp
locks the NRT thread when it wants to write data from the buffer to the disk. AFAICT, this is only necessary because the user might accidentally free the buffer concurrently (which shouldn't really happen).I understand that (ab)using Server sound buffers for disk I/O is convenient because it already handles the opening and closing of soundfiles. However, it also means the disk I/O thread is implicitly tied to the NRT thread, which kind of defeats the whole purpose of having a dedicated disk I/O thread in the first place...
Note that asynchronous commands executed on the NRT thread can take an arbitrary amount of time!
This causes problems such as this: https://git.iem.at/pd/vstplugin/-/issues/58
The text was updated successfully, but these errors were encountered: