Skip to content

Commit

Permalink
Add FAQ question about reentrant calls
Browse files Browse the repository at this point in the history
  • Loading branch information
avylove committed Dec 26, 2020
1 parent d155e52 commit 1bce612
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion doc/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ does not reference a valid TTY.
eol

Can you add support for _______ terminal?
---------------------------------------------------
-----------------------------------------

We are happy to add support for as many terminals as we can.
However, not all terminals can be supported. There a few requirements.
Expand Down Expand Up @@ -79,3 +79,18 @@ However, not all terminals can be supported. There a few requirements.
3. Terminal dimensions must be detectable

The height and width of the terminal must be available to the running process.

Why does ``RuntimeError: reentrant call`` get raised sometimes during a resize?
-------------------------------------------------------------------------------

This is caused when another thread or process is writing to a standard stream (STDOUT, STDERR)
at the same time the resize signal handler is writing to the stream.

Enlighten tries to detect when a program is threaded or running multiple processes and defer
resize handling until the next normal write event. However, this condition is evaluated when
the scroll area is set, typically when the first counter is added. If no threads or processes
are detected at that time, and the value of threaded was not set explicitly, resize events will not
be deferred.

In order to guarantee resize handling is deferred, it is best to pass ``threaded=True`` when
creating a manager instance.

0 comments on commit 1bce612

Please sign in to comment.