The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

does WAIT command in userRPL do a busy wait?
Message #1 Posted by Pier Aiello on 14 May 2013, 7:29 a.m.

First: hi to all, i'm new here. I have an account on the hp official forum but seems that this forum is more technical (maybe i'm wrong) and moreover it allows questions about userRpl and the hp49g+/50g series. I tried to search an answer to the following question but i found nothing, sorry.

The question: i have an hp 50g and i know that the userRpl is not so energy efficient (unfortunately) due to emulation. Now if i use the command:

0 wait 

The calculator just wait for a keypress and go even in standby mode.I guess that this behaviour doesn't need a lot of energy or computations. While if i use

5 wait 
The calculator seems to be busy. Can you confirm that? Does "5 wait" do a busy wait, using the CPU?

Thanks in advance for the reply.

Edited: 14 May 2013, 7:35 a.m.

      
Re: does WAIT command in userRPL do a busy wait?
Message #2 Posted by Software49g on 14 May 2013, 7:50 a.m.,
in response to message #1 by Pier Aiello

Hello,

> 0 wait
Runs the WaitForKey Loop which is a Parameterized Outer Loop.

> 5 wait
Runs a Saturn ML-Loop waiting the given ticks calculated from the
given seconds.

So without looking further into the code of the two different loops
the first loop most likely uses less energy, as in a POL only a
low level loop is running that scans for a key press.

HTH,
Andreas
http://www.software49g.gmxhome.de

            
Re: does WAIT command in userRPL do a busy wait?
Message #3 Posted by Pier Aiello on 14 May 2013, 8:10 a.m.,
in response to message #2 by Software49g

Thanks andreas! (and hi! We lose the contact years ago!)

                  
Re: does WAIT command in userRPL do a busy wait?
Message #4 Posted by Software49g on 14 May 2013, 8:28 a.m.,
in response to message #3 by Pier Aiello

> We lose the contact years ago!
Well, I wouldn't go that far ;-)
But there is next to nothing activty in Italy for the 50g.

Regards,
Andreas
http://www.software49g.gmxhome.de

            
Re: does WAIT command in userRPL do a busy wait?
Message #5 Posted by Pier Aiello on 14 May 2013, 3:57 p.m.,
in response to message #2 by Software49g

Anyway, do you know others commands to achive a delay with no busy wait with user/syRpl?

                  
Re: does WAIT command in userRPL do a busy wait?
Message #6 Posted by Software49g on 14 May 2013, 4:13 p.m.,
in response to message #5 by Pier Aiello

> with no busy wait with user/syRpl?
What do you mean with busy wait?
If you mean the busy annunciator you can simply turn it off with SYS-RPL or Saturn-ML.

HTH,
Andreas
http://www.software49g.gmxhome.de

                        
Re: does WAIT command in userRPL do a busy wait?
Message #7 Posted by Pier Aiello on 14 May 2013, 4:38 p.m.,
in response to message #6 by Software49g

No, i meant: http://en.wikipedia.org/wiki/Busy_waiting

In other words, a delay cycle that doesn't use a lot the CPU but simply wait X milliseconds/seconds.

                              
Re: does WAIT command in userRPL do a busy wait?
Message #8 Posted by Software49g on 14 May 2013, 4:51 p.m.,
in response to message #7 by Pier Aiello

Thats what the POL is designed for.
So you probaly have to write your own POL with the wanted
condition(s).

You can also use the words that are used to construct a POL
according to your needs.

HTH,
Andreas
http://www.software49g.gmxhome.de

                                    
Re: does WAIT command in userRPL do a busy wait?
Message #9 Posted by Pier Aiello on 15 May 2013, 4:28 a.m.,
in response to message #8 by Software49g

I'll try :)

                  
Re: does WAIT command in userRPL do a busy wait?
Message #10 Posted by C.Ret on 15 May 2013, 4:06 a.m.,
in response to message #5 by Pier Aiello

Quote:
Anyway, do you know other commands to achieve a delay with no busy wait with user/syRpl?

Hi,

A few years ago, we get a new software to drive the mass spectrometer and treat mass spectra. I was not confident in this new piece of cake. So, I have used my HP-28S quite often to check mass attribution, spectra de-convolutions and statistics I obtained from this new (fully integrated and sophisticated) software.

Unfortunately, my poor Advance Calculator was a bit slow (I have not spend a lot of time in optimization or using adapted algorithm – I had prefered ‘brute force’ computations or systematic/algorithmic seeks – my priority was to be sure I don’t miss anything obvious).

The computations on my HP-28S was split in three logic blocks; input of survey data, deconvolution and factor analysis, list of main facts/mass peaks and individual mass-peak ions attribution with filters for coherent attribution with chemical formula coherence, mono- or poly- isotopic patterns, natural relative abundance of elements, etc…

Each block of computation was carried on a separate bunch of dedicated userRPL commands. Each long run command was ended with a BEEP and activate a custom MENU which give me the opportunity to continue to the next(s) step(s) of the process.

No WAIT or INKEY or INPUT was used. There were no ‘busy waiting’. The calculator simply turns off after a few minutes unattended. This appended often, I was busy, my attention was mainly on driving the spectrometers and survey analysis was mainly performed as a background task. And the verification by the HP28S, when needed was the background of the background! (But, still an important task, especially because the new software has bugs and the user often miss to correctly activated the numerous and obscure options on it!

Conclusion:
The other commands to achieve a delay with no busy wait until the user response I know is to split each part of the computation into a dedicated RPL command. Eventually using the custom MENU facility to prepare the interface for the next(s) step(s) and, in case of long run, attract attention of the user by a short BEEP. If no response arises in the moment, the calculator will simply turn off.

The late user will have to turn it back on. Fortunately RPL calculators keeps stack, menu, etc through ON/OFF power cycles.

Results and soft menus will then clearly indicate at which step of the total process the calculator has stop. Continuation or adjustments may be easily available, by specific soft-menu key assignation.

                        
Re: does WAIT command in userRPL do a busy wait?
Message #11 Posted by Pier Aiello on 15 May 2013, 8:09 a.m.,
in response to message #10 by C.Ret

Quote:
The other commands to achieve a delay with no busy wait until the user response

But what i want to achive is: wait without the user response.

A little explanation of my program in ultra pseudocode

number = 0
repeat
  number +=5
  show the number
  wait for 5 seconds
until the number is higher than 1000

but the WAIT coomand, as Andreas stated, seems to do a busy wait (1). I thought that there is a way to achieve a sort of "sleep" without computations and user interaction. Even the Parameterized outer loop (following the 2nd sysrpl guide of Kalinowski, Dominik ) needs an event by pressing a key to work.

(1): Andreas i tried the "dowait" command in a small sysrpl program but it seems to achive the same effect of xWAIT (i mean the userRPL command mapped in SysRPL), can you confirm?

Edited: 15 May 2013, 8:12 a.m.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall