• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 283
  • Last Modified:

event scheduler

I'm working on a program that controls a machine in which the program tells the machine to do tasks.  Sometimes the tasks will need to happen close to the same time and we are using threads to do that.  I want to know how windows xp's event scheduler handles the task and what tasks a barebones xp with just our software on it will run.  I'm trying to get an idea of timing because if xp starts some task that won't let our program run for a long period of time then we might have issues and might have to change OS's maybe to a real time OS.  Can anyone give me some input to the matter or a link where I can find it.  So far I have done some testing get times between sending and receiving communications and at first glances it looks fine but are there things or windows events that I'm missing that might cause problems.
0
docieb
Asked:
docieb
2 Solutions
 
jkrCommented:
http://support.microsoft.com/kb/148404/en-us ("High-Precision Timing Under Windows, Windows NT, & Windows 95") sums that up pretty nicely:

------------------------------->8---------------------------

The multithreaded environments of Windows NT and Windows 95 employ CPU scheduling techniques to improve processor utilization and smooth multitasking. The portions of code, called threads, within the system are organized into queues and assigned priorities. Threads of code required by the operating system are assigned high priorities. The thread scheduler allows a thread a predetermined amount of execution time (quantum). Then it evicts the thread from the processor until all threads at the specific priority level have been serviced. The process continues at the next, lower, priority level. The timer-servicing thread, like applications, is subject to CPU scheduling and eviction regardless of the thread priority. Given that the number of threads ready for execution changes frequently, the period between timer thread executions can vary dramatically.

For example, say five time-critical threads are ready for execution, and the quantum is q milliseconds. If the timer thread is fifth, four threads execute before the timer thread is executed; q milliseconds x 4. This means that if q is 25 milliseconds, 100 milliseconds will have elapsed before the fifth thread is executed. Boosting the priority of the thread that created the timer risks introducing instability in the system by starving the time-sensitive, system-critical threads.

------------------------------->8---------------------------

The same applies to XP also. So, if you don's have anything else running on the machine, you should be on the safe side unless you need timing intervals that are way below 10ms.
0
 
Deepu AbrahamR & D Engineering ManagerCommented:
I don't think you will face any problem unless your application and any scheduled application uses a common resource like a file.

simple example: try to open file which is currenlty getting scanned by the any virus scanners.It will take a little while since the virus scannersare holding those files.Make sure you don't have any dependencies like these.Other wise windows is multithreaded/multitasking OS.

Best regards,
Deepu
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now