Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 247
  • Last Modified:

REAL-time priority in W95

Is there any way to give a REAL
"time-critical priority" to thread or
"REAL-TIME PRIORITY CLASS"  to process
in Delphi application for Windows'95,
so it couldn't be interrupted at all by other processes
nor by system Kernel? Thanks.
0
Fatman121898
Asked:
Fatman121898
  • 5
  • 3
  • 3
  • +4
1 Solution
 
MatveyCommented:
I doubt that `95 structure allows this gimic, but I'd also love to find a way...
I wonder what is the purpose in your case?
0
 
ZifNabCommented:
I'm afraid there isn't... but who am I to know? I learn everyday from this site.
0
 
williams2Commented:
No, if there was only one thing you couldn't do, this would be it!!!! ..every task need to go through the kernel, because of the system allocation table. If you even though took away the process timing, the OS would crash immidiately.

Regards,
Williams
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
ZifNabCommented:
for realtime-critical applications you need other OS & hardware.
0
 
MatveyCommented:
I'm not pessimistic by nature, so I wouldn't dump the idea without getting some proove. I wonder what example can I bring here? Uhhm... The Defragment tool isn't a good one, though it proovs that low level hardware access tools aren't impossible. It does however restart the whole process if it detects some disk activity from other running threads. What else?... My new scanner! When I scan something, the system is absolutely hanging. I don't know how it achives this - maybe transfer from the paralel port does it? I doubt it, there must be something else. But this is a good example - even the mouse pointer is disabled. This must be something we caould lern from, I guess. I'm intrigued!
0
 
ZifNabCommented:
Well, for my comment I meant that windows and the normal pc hardware is just not designed for realtime business.... I sure wouldn't want to run my factory processes(if I had a factory :-))  on windows machines.... Realtime has just other requirements...

Matvey, do you have OS NT? and is the scanner software for 95/98? Then it's possible from your ports.... because in win NT the ports (and other things) are far more protected than 95/98/.. In WinNT you can just forget to write directly to a port...

Zif.
0
 
MatveyCommented:
Hi Tom. I've win 95 and the software was supposed to work with it. Actually it does, and as I've seen in some other scanners this "real-time transfer" must be delaying all other threads somehow.
The PC isn't the best solution if you want to deal with satalite control from NASA, or even the simplest realtime DSP, although some people are very eager to try. Even taking in account the stupid "_universal_" architecture of it, both examples WERE IMPLEMENTED on it! Why do we all have PCs? I'd love to have a Mac, but I'm so sure I won't find any reasonable way to work with it, while my job and friends have other pets. Of course it's about compatibility and popularity. If you want to make something for wide use - do it for the PC, else you should be exactly sure of what you're doing and who's buying, because you won't have many customers here ;-)

Mat
0
 
williams2Commented:
Hmmmmmmm.. PC's are NOT build for realtime processes, that's for sure, but if you want a scanner that doesn't hang on your machine, you should go buy a scanner with SCSI extensions, then you will not have the problems above.

To some of you that didn't realise that not everything are solved with software.

Some scanners are build being able to write their result to a memoryextension or a SCSI-harddisk. SCSI harddisks are very handy for this purpose.

Zif: I wouldn't trust using a sattelite control, if there was no suitable realtime hardware made for the exact purpose - and why I know that? - My very best friend is a hardware engineer who works for the government doing exacly this to control both missiles and sattelites - and guess what? They also use PC's for this.

Regards,
Williams
0
 
dejohn99Commented:
In Win95, if your process doesn't make calls to ProcessMessages or handleMessage, the Win95 kernel is not called and your process takes over the entire box.  This is subject to hardware interrupts and DMA accesses of course, but  it also means the Windows 95 cannot redraw screens or perform any of its own tasks.

This is why any scanners and such with slow interfaces will bog down the other threads.  It's not so much giving the thread a higher priority as refusing to return control to the OS.  Win95 and 98 are still DOS at their core, and when they pass control to a thread it takes over the box until it relinquishes that control.

williams2 has the right approach to this problem I think.  It also is the macintosh solution - run anything with major throughput through a SCSI port and forget about it.
0
 
dejohn99Commented:
BTW: Most gas plants now are run off of PC's running Windows.  Of course the PC is merely a front end for a dedicated bus addressing a network of intelligent controllers with only a few controls on each piece.  The PC operator makes the big decisions, and the routine decisions are made by the microcontrollers.  They notify the PC on a regular basis of any changes they have made, so the PC is always ΒΌ second or so behind the reality of the plant's status.  Since this is as fast as a human can react anyways, it is close enough to real time for practical purposes.
0
 
EmmDiehCommented:
Yes, there is.
For example the nice command line utility from the unix95 package allows you to change the priority to idle, norm, high or real.
And the CreateProcess-WinAPI function allows to specify the priority class in the dwCreationFlags parameter.
But you shouldn't use this priority class to perform long tasks
otherwise the system doesn't perform well.


0
 
simandoffCommented:
You can try this:
  SetPriorityClass(GetCurrentProcess, REALTIME_PRIORITY_CLASS);
  SetThreadPriority
            (GetCurrentThread,THREAD_PRIORITY_TIME_CRITICAL);

Under NT it works fine, but under win9x, there is some problems.
For example some VXD device drivers can interrupt your application, because of their internal calling structure.
To be sure your application never stops under win9x you must
write your own VXD. That's all.
0
 
Fatman121898Author Commented:
Hi, Simandoff,
SetPriorityClass and SetThreadPriority are good for much purposes, but not for
mine. I need a REALLY Realtime priority, which means stopping ALL other processes while my own one is running (this will get about 3 seconds). All answers I got tell me that this is impossible in such a OS like W95. So, I'm affraid I'll have to give up and "downgrade" to W3.11.
Fat.
0
 
Fatman121898Author Commented:
Hi,Matvey,
The purpose of my process is to read data from parallel port, which is connected to external ADC hardware, working in real time - means new sample every 10mS for about 3 seconds. I have no possibility to change hardware with intelligent one (which is most probably the real solution in my case) nor OS platform, because my time is up.
Fat.
0
 
MatveyCommented:
Then how about the idea dejohn99 suggested: do not return control to windows, instead just read all data from the port inside one procedure?
0
 
Fatman121898Author Commented:
There is still some Windows activity even if a DOS application is working.
But  I found the way...incredible simple.
0
 
MatveyCommented:
Share it! :-)
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 3
  • 3
  • +4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now