flat assembler
Message board for the users of flat assembler.

Index > Heap > Realtime software under windows

Author
Thread Post new topic Reply to topic
rocketsoft



Joined: 26 Jan 2010
Posts: 189
rocketsoft
Is this really possible?
I tried setting my programs priority to realtime... but didn't work

I did succeed by setting the core affinity to core 2
it now runs uninterrupted and only on core 2 (Realtime)
function used: SetProcessAffinityMask

I need it becouse i connect my own hardware to the parallel port
and it must be controlled realtime!
Post 28 Jun 2011, 11:18
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17271
Location: In your JS exploiting you and your system
revolution
Another option is to write a driver, capture interrupts directly, and pass buffered data to/from the app as required/requested.

If you need realtime priority because your are using polling, and can't use interrupts for whatever reason, then you're options are much more limited.
Post 28 Jun 2011, 11:31
View user's profile Send private message Visit poster's website Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3500
Location: Bulgaria
JohnFound
the therm "real time" is somewhat blurry. It means that the program should react faster than the needed changes in the physical system that have to be controlled. So, in order to call some OS "real time", it must have predictable (not necessarily fast) time of reaction.
As a rule, Windows reaction in not predictable at all.
Nevertheless, with careful programming Windows can control real time systems, if they are not too fast.
For example, I have several assembly written programs that control production machines and as a rule they work fine with only effect that sometimes they make some little pauses waiting Windows to react on changes.
On the other hand, in the factory I am working, we have a machine controlled with Windows (delphi program) that fails sometimes because of the Windows (or delphi program?) slow reaction (nothing serious, just stops with error message).
According to my experience, the main problem for slow reaction of Windows, are some antivirus programs. They usually works with high priority and tend to block the whole OS activity while scanning.
Post 28 Jun 2011, 16:36
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17271
Location: In your JS exploiting you and your system
revolution
Sorry for offtopic ...
JohnFound wrote:
According to my experience, the main problem for slow reaction of Windows, are some antivirus programs.
Erm ... might one ask as to why you need AV on an industrial control machine? Surely you don't have them connected to the public Internet. Or do you? Why do I suddenly have visions of Conficker :S Air gaps, and no sneakernet, is the proper way to do AV IMO.
Post 28 Jun 2011, 16:47
View user's profile Send private message Visit poster's website Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3500
Location: Bulgaria
JohnFound
revolution wrote:
SErm ... might one ask as to why you need AV on an industrial control machine?


Well, there are operators in these machines and the computers need some operator interaction and also most of our machines have connection to the network (of course intranet, but it is international intranet) because they have to write some information to the central database server.
So, theoretically, the operators are able to run some malware on the system.
Post 28 Jun 2011, 20:02
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Enko



Joined: 03 Apr 2007
Posts: 678
Location: Mar del Plata
Enko
Quote:

They usually works with high priority and tend to block the whole OS activity while scanning.

Mostly they hook the winodows create/copy/move file functions from the api.
So when you unzip somthing, the antivirus scans every file extracted.
When I nead to install somthing that creates many files, or unzip a zip with a lot of files, i turn off the untivirus (nod32)


I don't know if it will helps, but on xp, sometimes I find that the performance of a video game or even internet response get more consistent if the process Explorer is terminated.
Post 28 Jun 2011, 21:56
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
There's realtime systems and then there's realtime systems... Windows hasn't been designed to be realtime (there is some 3rd party extensions though), and IMHO it seems plain wrong to run a full generic graphical OS if you have hard-realtime requirements...

But with a multicore system, thread affinity, admin privs(!) to set full "realtime" process+thread priority, and/or perhaps customer drivers, you should be able to handle at least soft-realtime tasks.

But why would you do that? Do you need user interaction on the system? If you're serious about realtime, wouldn't it make more sense to have a small, dedicated box that solely handles that control, running QNX or RTLinux or (...)?
Post 04 Jul 2011, 15:11
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.