[Info-vax] Volatile, was: Re: yet another sys$qiow question

Stephen Hoffman seaohveh at hoffmanlabs.invalid
Fri Aug 28 17:06:24 EDT 2015


On 2015-08-28 20:36:15 +0000, Bob Koehler said:

> In article <55e0994f$0$17002$b1db1813$2411a48f at news.astraweb.com>, JF 
> Mezei <jfmezei.spamnot at vaxination.ca> writes:
>> 
>> And when discussing with people who deal in real time, they are all 
>> adament that it must all be an event loop, no ASTs allowed. So while I 
>> never had to do this, I think it is possible that some types of apps 
>> might actually do need to poll the IOSB as part of their real time 
>> event loop. (if it is more efficient than checking event flags).
> 
>    Did tons of ASTs in real-time.  Hard real-time.  I'd never want an 
> event loop.

X Windows is not an appropriate real-time interface, as you are well 
aware and as you have (or would have) undoubtedly decoupled when you 
needed to interface with or display data via X.

So... Near real time, soft real time, hard real time, cushy real time, 
hammer time, happy time whatever, you're probably not directly driving 
the UI from your code.  So...  not a common and probably not an 
appropriate mix.

For what you get out of it, OpenVMS DECwindows X programming is 
unfortunately a whole lot of work, as compared with OS X.   X 
programming is easier with the use of UIL compiler and yet easier with 
something akin to VUIT or BX in use, but it's still a longer slog and 
the X APIs on DECwindows are much lower level and more programming 
effort for what you get.   As compared with the OpenVMS DECwindows X 
Windows interfaces, I'd look to use a higher-level and more abstracted 
interface here, and for various reasons.  Or VUIT or BX or UIL if I had 
to...  Direct X library calls, not so much.

>    But I know a few who don't understand there systems and do want an 
> event loop.

Event loops are fairly common.  Familiar.   OS X uses a run loop, as 
does Windows, as do various other platforms.

The construct of your code being called from "elsewhere" might take a 
little getting used to, but it's also really what happens with OpenVMS 
programs — though not nearly as overtly as with an event or run loop.   
With OpenVMS, you're called from the image activator, and eventually 
return there.  Callbacks into your code do exist, but they're resulting 
from calls you make, and they're not as widely used.

As for event loops and some event-driven applications, having a block 
or a lambda triggered for the event is a simple model — "inverting" the 
flow control wouldn't be a big deal.  Particularly nice if you have 
threads running across the available cores, and can dispatch threads as 
necessary.

Is an event loop appropriate for all applications?  No.  But then I 
also don't expect an Oshkosh ARFF — as fast as those crash-rescue 
trucks are — to get the fastest lap times around the Nürburgring, 
either.  Right tool, right job, etc.





-- 
Pure Personal Opinion | HoffmanLabs LLC




More information about the Info-vax mailing list