Re: [AD] Added yield_timeslice to vsync

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> The busy loop is just the same as "rest" - so I see no problem at all
> adding yield_timeslice with your patch.

I think it would have been acceptable with the former behaviour of 
yield_timeslice, but I'm not convinced at all it is now.

> For other drivers, where vsync synchronizes to the monitor refresh -
> this really can be dangerous, since e.g. a 100 Hz monitor will refresh
> every 10 ms - the timeslice in linux can be 20 ms :| To do this without
> busy waiting in Allegro, there would need to be a blocking vsync command
> built into the OS. It would say: Wait vor the vsync, and then return in
> the very moment it occurs. Maybe this is the case e.g. with DirectX? In
> that case, yield_timeslice wouldn't be needed.
>
> I guess, we just need to try it. I don't have access to DirectX or DGA
> currently, just X11 and OpenGL - so I can't do much more testing.

I think it is not worthwhile to open yet another can of worms for that.

> About yield_timeslice, maybe we should make a config option for it, like
> this:
>
> [system]
> busy_waiting = on/off
>
> Default would be off, so Allegro programs would behave nice. If you set
> it to on, yield_timeslice would do the 4.1.12 behavior. Then we could
> use yield_timeslice whereever something waits, but users/games would
> have an option to just run without busy waiting and 100% CPU usage,
> therefore possibly getting better precision.

Yes, that's interesting.

-- 
Eric Botcazou




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/