How to run Realtime Application in win32 environment

A

Arsalan Ahmad

Hi all,

Please tell me is there any possibility to disable all background services
and everything in win32 (Windows 98, win2000 and win XP) and run only a
single application in Real-Time mode so that only this application utilizes
CPU cycles. This application utilizes serial communication, usb camera and
draw output of the camera on monitor. Any idea for any of the OS i.e. 98, 2K
or XP(specially win2k or XP)???

Thanks,

Arsalan
 
D

Dave Patrick

You can set the Reg_Sz string value of;
"Shell"="Explorer.exe"
to the full path of the program you wish to start by default. found at
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon

For example to start the command interpreter;
"Shell"="C:\winnt\system32\cmd.exe"

You may be able to define this per user at;
HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect


:
| Hi all,
|
| Please tell me is there any possibility to disable all background services
| and everything in win32 (Windows 98, win2000 and win XP) and run only a
| single application in Real-Time mode so that only this application
utilizes
| CPU cycles. This application utilizes serial communication, usb camera and
| draw output of the camera on monitor. Any idea for any of the OS i.e. 98,
2K
| or XP(specially win2k or XP)???
|
| Thanks,
|
| Arsalan
|
|
 
R

Roman Ziak

Arsalan said:
Hi all,

Please tell me is there any possibility to disable all background services
and everything in win32 (Windows 98, win2000 and win XP) and run only a
single application in Real-Time mode so that only this application utilizes
CPU cycles. This application utilizes serial communication, usb camera and
draw output of the camera on monitor. Any idea for any of the OS i.e. 98, 2K
or XP(specially win2k or XP)???

There may be multiple aproaches to this, depending how tight you want to
utilize all CPU cycles. If you are ok with ocasional preemption, you may
try set the priority of your thread/process to highest.
With this method I achieved ~100us latency in user (ring3) mode.

Different aproach would be to write a kernel mode thread, apparently
these do not get preempted, did not try.

If you will get stuck, consider XP Embedded or CE.
It's called DOS. You boot to it.

The answer is off-topic.

If Tektronix can handle 6Gs/s with Win2k on their scopes, and HP uses
Win98, then the OP should definitely be able to use Windows for his app.

Roman
 
S

Slava M. Usov

[...]
Different aproach would be to write a kernel mode thread, apparently
these do not get preempted, did not try.

They do get preempted, unless they raise their IRQL to the DPC or higher
level, but then they cannot use most of the OS services. And even then
interrupt service routines will still be preempting them.

S
 
R

roman ziak

Arsalan said:
Hi all,

Please tell me is there any possibility to disable all background services
and everything in win32 (Windows 98, win2000 and win XP) and run only a
single application in Real-Time mode so that only this application utilizes
CPU cycles. This application utilizes serial communication, usb camera and
draw output of the camera on monitor. Any idea for any of the OS i.e. 98, 2K
or XP(specially win2k or XP)???

Just curious, why would you need to utilize all the cycles for something
like USB camera, serial comm and display ?

I can see the need for exclusive CPU utilisation only if you would be
polling some fast events, bitbanging PWM etc. Serial and USB comms on
Wintel platform are hw+sw buffered and handled by OS quite well.
 
A

Arsalan Ahmad

Hi all,

Now there is one another question. Usually when we dispatch a message then
it goes to the end of the message queue with the exception of WM_PAINT
message. I want another message to be processed first. Is there any way?

Thanks,

Arsalan
 
G

Gary Chanson

Arsalan Ahmad said:
Hi all,

Now there is one another question. Usually when we dispatch a message then
it goes to the end of the message queue with the exception of WM_PAINT
message. I want another message to be processed first. Is there any way?

No. If you want it executed immediately, send it instead of posting it.
 
J

Joel Kolstad

Roman Ziak said:
If Tektronix can handle 6Gs/s with Win2k on their scopes, and HP uses
Win98, then the OP should definitely be able to use Windows for his app.

You probalby know this, but those scopes use several processors and plenty
of dedicated hardware to cpature those 6 Gsps... the Windows CPU probably
spends most of its time running the GUI, cycle-wise!
 
A

Arsalan Ahmad

From where can I get information about wintel platform?? What is it
sxactly?

Thanks,

Arsalan
 
A

Arsalan Ahmad

Ok but then how is it related to my question. I have an application which
perform some matrix operations that take a lot of CPU time. I want to
minimize (not by changing algorithm right now) this CPU time. I know that in
win32(win9x, win2k & xp) Operating system takes a lot of time. I want my
application to run in real-time mode. It is MFC simple view based
application which takes input(image) from a USB-based WebCam and perform
some image processing on that image(I like to mention that i do all the
image processing in WM_PAINT event i.e. OnPaint() message handler and
display it. How is it possible to minimize my that imageprocessing time(not
by changing algorithm right now)? Just any idea? any?

Thanks,

Arsalan
 
A

Arkady Frenkel

You have to make profiling to find how it the time.
To make profiling for windows functions you can use
ApiMon from Resource Kit. If you see that all time eats by your calculation
and you want to redice it for any price, you need to move it on different
thread with real-time priority ( create thread suspended and set its
priority to real-time ).
Arkady
 
R

roman ziak

Arsalan said:
Ok but then how is it related to my question. I have an application which
perform some matrix operations that take a lot of CPU time. I want to
minimize (not by changing algorithm right now) this CPU time. I know that in
win32(win9x, win2k & xp) Operating system takes a lot of time. I want my

Arsalan, this is wrong. OS does take very little time unless you ask it
to do something for you or you are running a background virus scanner as
a service.
application to run in real-time mode. It is MFC simple view based
application which takes input(image) from a USB-based WebCam and perform
some image processing on that image(I like to mention that i do all the
image processing in WM_PAINT event i.e. OnPaint() message handler and
display it. How is it possible to minimize my that imageprocessing time(not
by changing algorithm right now)? Just any idea? any?

If you do not want to change algorithm, consider changing the compiler,
unless you are already using a good optimizing one. We have an image
processing commercial product, which we used to compile with Visual C++
..NET 2002 Standard. After we switched to Professional and enabled
optimisations, we achieved 10-20% more FPS.

Roman
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top