Skip to content

Commit da9eabd

Browse files
committed
Add warning about realtime processing with Python
1 parent 6ab8896 commit da9eabd

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

jack.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,23 @@ def set_process_callback(self, callback):
851851
pthread_mutex_lock, sleep, wait, poll, select, pthread_join,
852852
pthread_cond_wait, etc, etc.
853853
854+
.. warning:: Most Python interpreters use a `global interpreter
855+
lock (GIL)`__, which violates the above real-time
856+
requirement. Furthermore, Python's `garbage collector`__
857+
might become active at an inconvenient time and block the
858+
process callback for some time.
859+
860+
Because of this, Python is not really suitable for real-time
861+
processing. If you want to implement a *reliable* real-time
862+
audio/MIDI application, you should use a different
863+
programming language, such as C or C++.
864+
865+
If you can live with some random audio drop-outs now and
866+
then, feel free to continue using Python!
867+
868+
__ http://en.wikipedia.org/wiki/Global_Interpreter_Lock
869+
__ http://en.wikipedia.org/wiki/Garbage_collection_(computer_science)
870+
854871
.. note:: This function cannot be called while the client is
855872
activated (after :meth:`activate` has been called).
856873

0 commit comments

Comments
 (0)