From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,894846be18e92713 X-Google-Attributes: gid103376,public From: Wiljan Derks Subject: Re: GNAT R/T Annex and Win95 Date: 1996/04/20 Message-ID: <3178FD23.78F0@nl.cis.philips.com>#1/1 X-Deja-AN: 150514350 references: <96041916380674@psavax.pwfl.com> content-type: text/plain; charset=us-ascii organization: Philips mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 2.0 (WinNT; I) Date: 1996-04-20T00:00:00+00:00 List-Id: Marin David Condic, 407.796.8997, M/S 731-93 wrote: > > Here's an interesting question which we've been thinking about > around here a lot: > > Do you consider Windows NT capable of being a "realtime" operating > system? (It doesn't seem to be advertised as such.... yet.) > ... > We need to know things like "If I execute a delay statement, will > I wake up and have a deterministic span of time between the clock > going off and my code resuming?" Similar questions for interrupt > processing and such. Or "will the OS dynamically rescale my task > priorities and screw everything up?" Or priority inversions that > can occur if a low priority thread uses an uninterruptable OS > routine. Lots of things are uncertain about NT WRT its use as a > realtime OS. > > (Of course, you can always buy a processor that executes a > quintillion instructions per second and hope the latencies never > get big enough to matter! ;-) > > Opinions? I'd really like to have some best guesses to pass on to > the folks here who do these sort of systems.To my opinion NT performs real good when it comes to real-time behaviour. To demonstrate this I wrote I program that shows this. The program determines the maximum variation that it takes to be rescheduled by the kernel. It gave me a maximum of 800 microsecond variation on a pentium 120. In the mean time I was copying files and clicking around on the desktop. This means that the variation of the time between the clock interrupt and the next procedure call in the waiting program is about 400 microseconds. Notice that this program runs at real time priority on NT. It will only run properly when it has the right priviledge. In practice you also whould need to lock your code into memory to avoid paging but that is another issue. But anyway here is the code. I think it shows how NT performs. When you ant to build the program you need GNAT and the NT bindings. with ada.text_io; use ada.text_io; with win32; use win32; with win32.winbase; use win32.winbase; with win32.winnt; use win32.winnt; with interfaces; use interfaces; with interfaces.C; use interfaces.C; procedure testnttime is failed:exception; Counter,Previous,Freq:aliased Large_Integer; Min:Longlong; Max:Longlong; Dif:Longlong; First:Longlong; begin if SetPriorityClass(GetCurrentProcess, REALTIME_PRIORITY_CLASS)=win32.false then raise failed; end if; if QueryPerformanceFrequency(Freq'Unchecked_Access)=win32.false then raise failed; end if; Put_Line("Performance Frequency is "&Freq.Quadpart'img); loop Min:=LongLong'Last; Max:=LongLong'First; sleep(1); sleep(1); if QueryPerformanceCounter(Previous'Unchecked_Access)=win32.false then raise failed; end if; First:=Previous.Quadpart; for i in 1..1000 loop sleep(1); if QueryPerformanceCounter(Counter'Unchecked_Access)=win32.false then raise failed; end if; Dif:=Counter.Quadpart-Previous.Quadpart; If DifMax then Max:=Dif; End if; Previous:=Counter; end loop; put_line("Maximum count "&Max'Img&" is "& Longlong'Image(Max*1000000/Freq.Quadpart)&" us"); end loop; end testnttime; Wiljan