Preventing Linux from switching tasks?

I have a GUI library which requires the underlying OS to prevent task switching during screen refreshes. Does anyone know how to do this in Linux? Or, if it is even possible?

Thanks for any reply!

Reply to
twgray
Loading thread data ...

What do you mean by "screen refreshes" ? Linux does not not include any software to refresh any screen.

Reply to
Geronimo W. Christ Esq

Linux doesn't, but the GUI library I am implementing does have screen refreshing, and it requires that the underlying OS suspend task switching while doing it.

Reply to
twgray

Why would task switching affect a screen refresh? Are you writing directly to screen hardware and would get a flicker?

Or is the screen refreshing not thread-safe?

May I guess that you only want one task to be accessing screen hardware at the same time?

Rufus

Reply to
Rufus V. Smith

That's a completely rediculous requirement. Any Unix app that can't tolerate being suspended at any point in its execution is completely and utterly broken. I suppose if you're using SysV shared memory you might have to use a semaphore to serialize accesses to shared data strucutres, but that's completely different that locking the scheduler completely.

--
Grant Edwards                   grante             Yow!  Inside, I'm already
                                  at               SOBBING!
                               visi.com
Reply to
Grant Edwards

Why ?

Reply to
Geronimo W. Christ Esq

As another person has already replied, it sounds like there is something fundamentally wrong with your design. The X window system that runs on pretty much all desktop Linux machines runs in user space, even on fairly low-spec machines, and it does not have this requirement to suspend the OS.

Reply to
Geronimo W. Christ Esq

Sorry for following up with three different replies.

Inside user space there is absolutely no way to prevent task switching. The whole point of a protected OS such as Linux is to stop user processes from locking up the machine.

If you move your code into the kernel and implement it as a kernel module, you can then disable interrupts. But putting a GUI library in the kernel is a fundamentally flawed idea, and in any case things would start getting very, very messy.

It sounds like your GUI library is a conflation between a higher level GUI toolset and a low level framebuffer device driver. If that is true, you will need to go back to the drawing board.

Reply to
Geronimo W. Christ Esq

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.