PDA

View Full Version : Disabling multitasking in Win XP


4world
01-14-2007, 07:58 AM
Hi,

I am new to this forum and was wondering if anyone can tell how to stop Win XP from switching out an application (i.e. giving nearly full CPU bandwidth to the application)? Basically disabling multitasking.

We are using .NET 2005 to write a program to send/receive data through the serial port and want to achieve full transmission speed with no gaps. Oscilloscope shows a gap which is inexplicable by looking at the coding so must be coming from Windows preemptive switching out of our application.

Thank you in advance.

Whyzman
01-14-2007, 08:38 AM
Welcome tohttp://www.pcguide.com/ubb/pcgubb.gif Forums!

I suspect we need someone much for computer savvy than I to comment, but I don't think computers actually multi-task. Processors are just really fast, and operating systems are designed to switch from one job to the next with such lightening speed that that it appears they are doing two or more jobs at the same time...

My thought is that you need to make sure that you have shut down processes that you don't need to have running and interrupting the processor from focusing on one project.

Even moving your mouse, by design, interrupts the processor...the same with the keyboard...

Sylvander
01-15-2007, 10:43 AM
"Pre-Emptive Multi-Tasking" [PMT] [used for Win32-based applications] makes the processor rattle around the jobs in the queue like a machine gun.
More than one application, each running a process, each process can run in multiple threads [Multithreading] and all threads running concurrently.
The processor spends a tiny amount of time on each thread's task and rattles around them in turn, so that any one task is given a RAPID sequence of short periods of time at the processor, and each continues until its job is completed.
Any one application running a particular process might initiate multiple threads.
e.g. Word might have one thread responding to keyboard presses to enter characters in a document; another performing spell checking or pagination; yet another spooling a document to the printer in the background.

The older "Co-Operative Multi-Tasking" [CMT] [used for Win16-based applications] worked in a similar but different way.
Each task was given the processors' time and continued until the job was completed, or the task relinquished the processor [the application yielded to other running tasks].
Only then did another task behind it in the queue get its chance at the processor.
This had the big disadvantage that if a task at the processor went into a loop, or froze, it would NEVER relinquish the processor, so no other task would ever be begun, never mind finish.

The big improvement of PMT over CMT was that the processor chose when to begin and end working on each task, and if one or more tasks froze or looped, it had no effect on any of the other tasks, which could go ahead and complete.

16-bit Queue
Is used for simple 16-bit application programs. [Does WinXP use these?]
Each task must wait its turn in the queue and can only be handled when its turn comes.
The mouse cursor events wait in a 16-bit queue, which is why the cursor can be jerky, or freeze.

32-bit Queue
I think each thread [a running program is a process and can run one or more threads] has its own dedicated 32-bit memory space allocated as a message queue to it alone. [no other threads' queue allowed to use that space]

Whyzman
01-15-2007, 04:14 PM
In my quick searching, I cannot see anyway to shutdown multi-tasking in Windows. You can, however, increase the performance.

http://ezinearticles.com/?Improve-Multitasking-Performance-and-Overall-Computer-Performance&id=172341

I suspect that what you are actually attempting to do is probably accomplished by a specially written software program that buggers with the interrupts and keeps the processor focused where you want it...

jlreich
01-15-2007, 06:40 PM
In task manager you can set the priority of any process higher or lower. I know this is not something you would want to have to do on every boot on every machine, but I know there is a way to do this without requiring user intervention.

If the priority were set higher it would get interrupted less often and for less time when it did get interrupted.

Hopefully that will at least point you in the right direction. :)

saphalline
01-18-2007, 02:16 PM
There's a standard class in the .NET framework for setting the process/thread priority (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdiagnosticsprocesspriorityclassclasstop ic.asp) in the code. There's also a way to set the priority of an executable by adding parameters to the command line of a shortcut. Both methods would work well enough in this case, I imagine. Just keep in mind that using .NET 2005 on a serial port is a bit silly :p so your results are difficult to predict.