Preemptive microthread

86 views
Skip to first unread message

Bach Le

unread,
Mar 14, 2013, 11:06:45 PM3/14/13
to pawns...@googlegroups.com
I need to be able to implement preemptive microthread using Pawn. Pawn programs are able to suspend and resume themselves so half of the pieces is there. Debug hooks get called once for every instruction so it greatly degrades performance. Is there a way to create a hook that gets called every n instructions?

petteri...@gmail.com

unread,
Mar 15, 2013, 2:25:01 AM3/15/13
to pawns...@googlegroups.com
Hi,
Debug hook is called once per every line.

You could modify the behaviour by changing the compiler to generate
"break" statements only e.g. at the end of every basic block.

Basically a thread would have to switch the Pawn stack, while using the
same data and code segments. This is simple in theory, but I don't know
what complications could arise.

--
Petteri
Reply all
Reply to author
Forward
0 new messages