|
From: Tim R. <ti...@su...> - 2004-03-26 04:56:38
|
I've found a relatively simple and I think plausible solution. I factored out the forcing of an interrupt check but implemented it for now as setting the interruptCheckCounter to -1000. In checkForInterrupts I also factored out a test (and implemented it as 'is iCC < -100') so that forcing a check no longer affects the feedback reset value. That at least stops it climbing to ludicrous values. There is a small potential cost in the check being done a bit more frequently. If we need to the force and test can be macroized to let platforms have more choice viz Mac using a cheap timer or whatever. I've also, for now, changed the nextPollTick increment to 100 mS instead of 500, to give some chance of a timely response to an interruptKey press during a heavy non-interactive process. We could quite reasonably make this settable via vmParameter or a platform macro if that is a problem. I made interruptChecksEveryNms vmParameter settable. I don't think the default of 3mS is very helpful towards achieving 1mS Delay response unless one wants to rely on enough forced interrupt checks being made so I changed to 1mS. Surprisingly few numbered prims need to force a check. Most that do involve some GC so I put the forcing there. Some platform support functions will be time consuming and the force can be added in those places easily. For example, on RISC OS a getNextEvent that results in polling the OS events is likely to take a while if some other app sucks up the cycles. I have the impression from Ian that X11 clipboard fetching can be traumatically long winded, so he can add a force to that code. This strikes me as better than imposing a forced check on every platform for all these things (io* and so on). I've also altered the ioMSecs() wrap handling code in checkForInterrupts. I think it was broken previously though given that the timer probably wraps every six days or so it is hardly a major problem. As I mentioned on the general list, I'm reasonably certain that Ned's recursive interrupt problem is not exacerbated by these changes. tim -- Tim Rowledge, ti...@su..., http://sumeru.stanford.edu/tim Useful Latin Phrases:- Recedite, plebes! Gero rem imperialem! = Stand aside plebians! I am on imperial business. |