Setting process priority (how to prevent lag?)


Author
Message
Blackadder
Blackadder
Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)
Group: Forum Members
Posts: 280, Visits: 147

Dear All,


we are having problems with lag in one of our experiments. Each trial is a sequential presentation of 30 BMPs, each about 350 kB in size. A new BMP is displayed every second frame at 60 Hz refresh rate.


The problem: it lags. Every other second or so, more than two frames will pass until a new BMP is displayed. We are currently trying to get rid of some active processes in our Windows 7 installation to prevent the scheduler from interrupting Inquisit's runtime too often.


While doing that, I read the following here: http://www.millisecond.com/products/inquisit4/timing.aspx


Furthermore, Inquisit can minimize the chance that other programs, including Windows itself, will steal CPU cycles from it by setting its process and threads to the highest priority level.


How can Inquisit do that? Is it a built-in feature? Does it need to be activated?


Bye, Malte


Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 108K

How can Inquisit do that?


Any process can submit a request to the OS to be running at a certain priority level.


Is it a built-in feature?


Yes, as per the above. But note that you can also manually set process priority, e.g. via the task manager on Windows.


Blackadder
Blackadder
Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)Supreme Being (27K reputation)
Group: Forum Members
Posts: 280, Visits: 147

Thanks, Dave! I am aware that any process or thread can request a certain priority level in Windows. SetPriorityClass() and SetThreadPriority() immediately spring to mind. I am also aware that process priority can be changed via task manager.


Since the latter does not ameliorate the lag by any significant margin for our specific experiment, I was hoping that the website quote implied that Inquisit not only hypothetically could but can and, at best, does tinker with process priorities.


If I understand your response correctly, Inquisit already does what it can to prioritize itself. Anything beyond the default installation and script settings is up to us, then?


Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 108K

If I understand your response correctly, Inquisit already does what it can to prioritize itself


Yes, that is correct.


I'm not sure about the frame-drop issue you are facing given that I know next to nothing about how you've set things up as well as your particular hardware. There are any number of possible points of failure:


- There may be some as yet undisclosed bug in Inquisit. I am not aware of such a bug, but that doesn't mean there isn't one. Unfortunately, one can at best prove the presence of a particular bug, never its absence.


- The graphics system may be doing something funky (driver or hardware issue or some weird interaction), i.e., to any software (including Inquisit) everything may look a-okay, but the (things close to the) metal don't actually do as they say.


- The 60Hz refresh rate suggest you are using some type of flat screen technology (TFT, LCD). All those screens have their own buffer on board. Software instructs OS to display something at a given point in time -> OS hands it to driver / graphics card -> graphics card sends data to display. Unfortunately this is a one-way street. The display may buffer the data for an unknown amount of time, apply some magic to it (think color correction, interleave calculations) and eventually decide to render the data to screen -- or not! Point being, the display actual never reports back to the OS / Software / graphics driver what it did and when.


Now, to start testing, in my Inquisit script I'd first divide my screen canvas into a 6x5 grid (left to right, top to bottom). Then, in the trial's first frame I'd draw to grid coordinate 1/1, third frame draw to 2/1, etc. That would allow me to see -- in context -- if, when and which frames get dropped.


Hope this helps,


~Dave


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search