Currently, the JIT engine waits on ALL traced processes to stop before handling the breakpoint. This is because it makes changes to the code blocks in all processes, which can cause inconsistencies and race conditions depending on where the tracee's PCs are.
One solution would be to have a shared queue of "patch" objects. A tracee stopped by a JIT-bkpt can cause the patcher to add a patch to the queue. Upon stopping, each tracee will check the queue for new patches. Once all threads have applied the patch, it'll be removed from the queue. (This can be tracked with an integer, e.g.)
Currently, the JIT engine waits on ALL traced processes to stop before handling the breakpoint. This is because it makes changes to the code blocks in all processes, which can cause inconsistencies and race conditions depending on where the tracee's PCs are.
One solution would be to have a shared queue of "patch" objects. A tracee stopped by a JIT-bkpt can cause the patcher to add a patch to the queue. Upon stopping, each tracee will check the queue for new patches. Once all threads have applied the patch, it'll be removed from the queue. (This can be tracked with an integer, e.g.)