Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Blocking means making some sort of system call that will cause the scheduler to put the thread to sleep – could be a wait on a futex, waiting for data, or an explicit sleep.

Speaking of which, do you know of a tool that would allow to ensure that e.g. your RT threads won't do bad things - short of putting a breakpoint on every syscall-like thing ? I wonder if at that point the audio community should not look into developing some clang-based static analyzer to enforce that.



There have been several such tools over the years - I regret that off the top of my head I don't recall the names of any of them.

Clang can be used for this but AFAIK you need to annotate functions/methods to indicate whether or not they are intended to be RT-safe. This gets complex if you have code that can be used in an RT context and in a non-RT context. The annotation part would be relatively simple in, say, a small audio player. In a DAW, it would be a substantial and complex task.


I've done things before where you shim in a library (using LD_PRELOAD) between the executable and the C standard library, and blacklist function calls which are potentially blocking, (abort if they get called in the wrong context).

It's usually sufficient to do this in testing, and then have as is, in production.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: