Preventing Linux from switching tasks?

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
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!


Re: Preventing Linux from switching tasks?
Quoted text here. Click to load it

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



Re: Preventing Linux from switching tasks?

Quoted text here. Click to load it

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.


Re: Preventing Linux from switching tasks?

Quoted text here. Click to load it

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





Re: Preventing Linux from switching tasks?
Quoted text here. Click to load it

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!
We've slightly trimmed the long signature. Click to see the full one.
Re: Preventing Linux from switching tasks?

Quoted text here. Click to load it

Why ?

Re: Preventing Linux from switching tasks?

Quoted text here. Click to load it

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.


Re: Preventing Linux from switching tasks?

Quoted text here. Click to load it

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.

Site Timeline