Sunday, July 23, 2006

VW's ProcessMonitor issue

A while ago, I wrote a piece to queue cursor change requests so that most of the CPU time wouldn't go into updating the screen (or transmitting such screen damage in an X/Citrix/Exceed scenario, for example).

Basically, it installs a high priority process that wakes up every 10th of a second and issues the primBeCursor to the cursor requested last. I was also careful to change the cursor immediately if the cursor is one of the three GC cursors, otherwise they'd never be seen.

However, there is an issue I haven't been able to figure out. Let's say you open the ProcessMonitor. This prevents screen refreshes outside the ProcessMonitor window, somehow (how?!). Then, you put the cursor on top of the ProcessMonitor and wait... eventually, you'll hit a scavenge, at which point:

  1. the cursor changes to the corresponding cursor,
  2. the process that changes cursors is killed.
I know the process is killed because if I amend Process>>terminate not to terminate that particular process, then it survives. The issue is that because the ProcessMonitor is open, I cannot open a debugger when I make Process>>terminate exit earlier. I also tried making it wait on a semaphore, but I have not seen any process wait on a semaphore in the ProcessMonitor, so I do not know which process kills the cursor change process.

I could try to debug it harder, but the tackiness of the approaches that come to mind makes me wonder if I didn't miss something more obvious.

Any ideas?

1 comment:

Andres said...

Finally! The issue was that the process managing the cursor changes was not a system process, and then doing something like ctrl-y would interrupt the user process running at highest priority... sigh...