branlwyd / bdcpu16

DCPU-16 simulator based on version 1.7 of the DCPU-16 specification. See http://dcpu.com/.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

make interrupts thread-safe

branlwyd opened this issue · comments

Currently, devices must wait until a safe time (e.g. when cyclesElapsed() is called) before they can call interrupt(). This means if a device wants to interrupt due to an out-of-band event (such as keyboard input) they have to keep their own queue of interrupts. This leads to added logic & storage.

Investigate whether it will hurt performance to add locking, or perhaps replace the current interrupt queue with a lockless/low-lock queue structure.