forked from falkTX/dssi-vst
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed sporadic xrun bug in shared memory code.
This one was hard to track down. The symptom was that a few times, sometimes several hours apart, the native plugin code would take much longer than normal to complete, causing xruns for the plugin host. It turns out that since the shared memory being used is backed by a file, the Linux kernel likes to flush the contents in memory back to the file occasionally. While it does this *it locks the memory pages*, meaning that the plugin, which tries to write to the memory, is suspended until the file write is complete. Of course, waiting for file I/O inside the realtime code is unacceptable, so we need shared memory that does not flush to disk. The fix was to switch to POSIX shared memory objects, using shm_open(), instead of normal file open(). Also fixed a trivial bug where the shared memory was opened twice (mkstemp already opens the file, but we still opened it again afterwards).
- Loading branch information
falkTX
committed
Aug 27, 2012
1 parent
2cefab1
commit 059098b
Showing
4 changed files
with
53 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,6 @@ class Paths | |
std::string defltHomeRelPath); | ||
}; | ||
|
||
int shm_mkstemp(char *fileBase); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters