Fullscreen thread priority

Bugs found in XnView Classic. Please report only one bug per topic!

Moderators: helmut, XnTriq, xnview

Post Reply
User avatar
foxyshadis
Posts: 395
Joined: Sat Nov 18, 2006 8:57 am

Fullscreen thread priority

Post by foxyshadis »

Something weird I noticed while running a video encoder in the background: The teardown thread for the fullscreen, that runs when you double-click to exit back to the browsers, gets verrrrrry slow. I looked in process explorer and noticed it has thread priority 1! Normal is 8, and Low is 4, but even idle priority processes will steal cycles from the user interface in this instance. (My encoder can only run at low unless I force it, so it gets pretty painful.)

No other part of the UI has this problem, that I've seen so far.
User avatar
xnview
Author of XnView
Posts: 46253
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Fullscreen thread priority

Post by xnview »

foxyshadis wrote:Something weird I noticed while running a video encoder in the background: The teardown thread for the fullscreen, that runs when you double-click to exit back to the browsers, gets verrrrrry slow. I looked in process explorer and noticed it has thread priority 1! Normal is 8, and Low is 4, but even idle priority processes will steal cycles from the user interface in this instance. (My encoder can only run at low unless I force it, so it gets pretty painful.)

No other part of the UI has this problem, that I've seen so far.
Only when you exit fullscreen?
Pierre.
User avatar
foxyshadis
Posts: 395
Joined: Sat Nov 18, 2006 8:57 am

Post by foxyshadis »

I wasn't checking for it at the time, but I downloaded wprime to totally load my cpu and found that it's actually the read-ahead cache. Disabled, it works fine (if slower) even in full-load conditions. However, it'll completely hang until the load is finished with read-ahead on, while it waits on processing the next image. Apparently the design of the cache locks the UI until it's done processing (?), which explains why it looked like it was happening when I tried to exit fullscreen.

I suppose a priority of 4-6 would make more sense, since it's a background task but one that's related to the UI, as opposed to something forgotten in the tray for hours like encoding.
User avatar
xnview
Author of XnView
Posts: 46253
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Post by xnview »

foxyshadis wrote: I suppose a priority of 4-6 would make more sense, since it's a background task but one that's related to the UI, as opposed to something forgotten in the tray for hours like encoding.
Where do you see that fullscreen thread has priority=1?
Pierre.
User avatar
foxyshadis
Posts: 395
Joined: Sat Nov 18, 2006 8:57 am

Post by foxyshadis »

This is a screen capture from process explorer, highlighting the thread that gets created and destroyed whenever the following image is being read:
Image
At this point it had probably been open for 10 seconds, note that it's not really using any cpu time.

What I found most interesting, though, is that it doesn't do that in the viewer or the 'view' fullscreen, only the 'browser' fullscreen. the threads are created with normal priorities and exit quickly there.

Edit: I just noticed that stax just raised the same issue this weekend, I feel silly now. ^^;;
Post Reply