Skip to content

GPIO IRQs are interrupting running JS code #585

@skadisch

Description

@skadisch

GPIO IRQs registered via "gpio.irq(callback[, event])" are executed as they arrive, interrupting the currently running program. Normally, JavaScript environments are of cooperative nature and schedule events in the event loop where they will be executed when the current task completes.

Further, using IRQs leads to a complete crash / hang, even in simple use cases. Most likely as things are not reentrant / thread safe.

Ignoring that this currently crashes, is it expected to behave like this? If yes, it should be mentioned in the documentation, also pointing out potential risks. If not, I would be happy to provide a PR.

If it is about speed, than at least it should run in an isolated JS context and communicate via messages, like a JS worker.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions