Bill, I get similar results to your test program.

INPUT PauseTime
FOR I = 1 TO 10
   StartTime = TIME()
   PAUSE PauseTime
   StopTime = TIME()
   CRT "Total time taken is " : OCONV(StopTime - StartTime, 'MTS'):
   CRT ", expected ": OCONV(PauseTime, 'MTS')
NEXT I

Run from ECL
Input = 5, Times taken: 6,10,10,10,10,10...
Input = 10, first time taken was 8, the next 9 where all 10.
...

So, clearly PAUSE aligns itself to a 10 second boundary and can only
operate on that.

Given this, PAUSE works correctly for any 10 second increment, AFTER the
first pause statement. Something like this should be added to the
document, because according to the manuals 'PAUSE 5' should work, but in
practice, it will actually running a 'PAUSE 10' with the first PAUSE
statement pausing for an undefined period. 

Regards,
Dan

-----Original Message-----
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Bill Haskett
Sent: Thursday, 8 April 2010 3:38 AM
To: U2 Users List
Subject: Re: [U2] UD: Phantoms

Well.  I have to apologize for disparaging PAUSE.  I ran tests by:

PauseTime = 30
StartTime = TIME()
PAUSE PauseTime
StopTime = TIME()
CRT "Starting at " : OCONV(StartTime, 'MTS')
CRT "Stopping at " : OCONV(StopTime, 'MTS')
CRT "Total time taken is " : OCONV(StopTime - StartTime, 'MTS')

...and the total time taken was rarely the PauseTime.  So I ran the test

with SLEEP and it worked properly.  So I replaced SLEEP with PAUSE in 
our background service program and it wakes up every minute on the exact

second.  So, I guess, my test program wasn't working.  Don't know why 
though.  :-(

Bill

------------------------------------------------------------------------
Bill Haskett said the following on 4/7/2010 10:02 AM:
> Dean:
>
> I ran some tests on PAUSE and it never seemed granular enough to 
> properly work when the time it wakes up important.  In other words, 
> I'd pause for 30 and it would pause for sometimes 26 seconds, 
> sometimes 28 seconds, sometimes 23 seconds, sometimes 25 seconds, but 
> never over 30 seconds.  SLEEP, however, always seemed to be on time.
>
> PAUSE was also cool in that I could find out which lines were paused 
> with the LIST.PAUSE command.  I could also WAKE the process from 
> another line.
>
> Our UD service program wakes up every minute on the minute.  I figure 
> out how many seconds until the next minute then, per Wally's 
> suggestion, I loop for that many seconds then SLEEP 1.  This has been 
> hitting the wake-up on the minute over quite a few machines for the 
> past week or two.  It appears PAUSE wouldn't come close to waking up 
> at the right time.
>
> Anyway, directing my attention to a previously unused BASIC statement 
> is always fun.  Thanks,
>
> Bill
>
>
------------------------------------------------------------------------
> dean.armbrus...@ferguson.com said the following on 4/7/2010 7:59 AM:
>> As an alternative to SLEEP, use PAUSE.  A process in PAUSE will
return
>> the call stack via PORT.STATUS.
>> SLEEP, CALLC, PCPERFORM, and waiting on a record lock are some of
most
>> common conditions which will not return a call stack via PORT.STATUS.
>>
>> Dean Armbruster
>> System Analyst
>> 757-989-2839
>>
>> -----Original Message-----
>> From: u2-users-boun...@listserver.u2ug.org
>> [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Wally
Terhune
>> Sent: Friday, April 02, 2010 2:05 PM
>> To: U2 Users List
>> Subject: Re: [U2] UD: Phantoms
>>
>> Not sure.
>> We do use signaling to 'interrupt' the running process and get it to
>> tell the PORT.STATUS session what it is up to.
>> IIRC, we use SIGUSR2,  specifically.
>>
>> So - there could be some system calls that the udt process is in that
>> cannot be interrupted.
>> For instance, I tested a phantom that was running 'SLEEP 120' -  and
>> experienced the same result as Bill (no call stack printed).
>>
>> I changed this to a loop FOR 120 that was printing a line, then SLEEP
1
>>
>> Here is the result:
>> :LISTUSER
>>
>> Licensed(UDT+CP)/Effective      Udt     Sql     iPhtm   Pooled
Total
>>
>>     (  32 + 32  ) / 64          2       0       0       0          2
>>
>> UDTNO USRNBR  UID USRNAME   USRTYPE  TTY    IP-ADDRESS    TIME
DATE
>>   1   5372 305730 WTerhune  udt     pts/1   Console       11:53:11 
>> Apr 02 2010
>>   2   6020 305730 WTerhune  phantom pts/2   Console       11:58:05 
>> Apr 02 2010
>>   3   2384 305730 WTerhune  udt     pts/3   Console       11:55:11 
>> Apr 02 2010
>>
>> :PORT.STATUS PID 6020 CALL.STACK
>>
>> Licensed(UDT+CP)/Effective      Udt     Sql     iPhtm   Pooled
Total
>>
>>     (32 + 32) / 64              2       0       0       0         2
>>
>> Udtno Pid       User       UserType     Port     Last command
processed
>> 2     6020      WTerhune   phantom      8443624
>>
>> level line  BASIC callstack
>> 1     4     BP\_WWW
>>
>> Session no command stack.
>> :
>>
>> Wally Terhune
>> U2 Support Architect
>> Rocket Software
>> 4700 S. Syracuse Street, Suite 400 **Denver, CO 80237 **USA
>> Tel: +1.720.475.8055
>> Email: wterh...@rs.com
>> Web: www.rocketsoftware.com/u2
>>
>>
>> -----Original Message-----
>> From: u2-users-boun...@listserver.u2ug.org
>> [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Bill
Haskett
>> Sent: Friday, April 02, 2010 10:22 AM
>> To: U2 Users List
>> Subject: Re: [U2] UD: Phantoms
>>
>> Wally:
>>
>> Thanks.  Using LISTUSER() I can figure out what processes are
phantoms
>> but not what they're running.  Thus, I have no way to figure out of
my
>> BACKGROUND.SERVICE program is running (it sleeps and wakes up every
>> minute).  When I do a PORT.STATUS PID {pid# of phantom} CALL.STACK
>> nothing is returned (and it takes about 15 seconds on a fast,
>> development system).
>>
>> 2 Dev (0)-> LU
>>
>> Licensed(UDT+CP)/Effective      Udt     Sql     iPhtm   Pooled
Total
>>
>>     (  24 + 1   ) / 25          3       0       0       0          3
>>
>> UDTNO USRNBR  UID USRNAME   USRTYPE  TTY    IP-ADDRESS    TIME
DATE
>>   1   2192 197614 AsiAdmin  phantom pts/1   Console       05:51:51 
>> Apr 02 2010
>>   2   3248 197615 wphaskett udt     pts/2   192.168.1.51  05:54:32 
>> Apr 02 2010
>>
>> 2 Dev (0)-> PORT.STATUS PID 2192 CALL.STACK
>>
>> Licensed(UDT+CP)/Effective      Udt     Sql     iPhtm   Pooled
Total
>>
>>     (24 + 1) / 25               3       0       0       0          3
>>
>> Udtno Pid       User       UserType     Port     Last command
processed
>> 1     2192      AsiAdmin   phantom      28101260
>>
>> 2 Dev (0)->
>>
>> Am I missing something?
>>
>> Thanks again.
>>
>> Bill
>>
>>
------------------------------------------------------------------------
>> Wally Terhune said the following on 4/2/2010 8:40 AM:
>>  
>>> Question wasn't clear to me.
>>> If looking at active processes, listuser shows which are phantoms 
>>> (USRTYPE column) Also - UniBasic LISTUSER() function returns this as

>>> dynamic array for easy parsing
>>>
>>> :listuser
>>>
>>> Licensed(UDT+CP)/Effective      Udt     Sql     iPhtm   Pooled Total
>>>     (  32 + 32  ) / 64          1       0       0       0      1
>>>
>>> UDTNO USRNBR  UID USRNAME   USRTYPE  TTY    IP-ADDRESS    TIME DATE
>>>   1   5936 305730 WTerhune  udt     pts/1   Console       09:34:36 
>>> Apr 02 2010
>>>   2   4300 305730 WTerhune  phantom pts/2   Console       09:34:58 
>>> Apr 02 2010
>>>
>>> Wally Terhune
>>> U2 Support Architect
>>> Rocket Software
>>> 4700 S. Syracuse Street, Suite 400 **Denver, CO 80237 **USA
>>> Tel: +1.720.475.8055
>>> Email: wterh...@rs.com
>>> Web: www.rocketsoftware.com/u2
>>>
>>>
>>> -----Original Message-----
>>> From: u2-users-boun...@listserver.u2ug.org 
>>> [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Martin 
>>> Phillips
>>> Sent: Friday, April 02, 2010 9:35 AM
>>> To: U2 Users List
>>> Subject: Re: [U2] UD: Phantoms
>>>
>>> Hi Bill,
>>>
>>>   "In UniData, does anyone know of a sure way to determine if a 
>>> BASIC program is running as a phantom?"
>>>    
>>> Take a look at the @USER.TYPE variable. This contains 1 for a
phantom.
>>
> _______________________________________________
> U2-Users mailing list
> U2-Users@listserver.u2ug.org
> http://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________
###########################################################################################
The information transmitted in this message and attachments (if any) is 
intended only
for the person or entity to which it is addressed. The message may contain 
confidential
and/or privileged material.  Any review, retransmission, dissemination or other 
use of
or taking of any action in reliance upon this information by persons or 
entities other
than the intended recipient is prohibited.  If you received this in error, 
please
contact the sender and delete the material from any computer.

The intended recipient of this e-mail may only use, reproduce, disclose or 
distribute
the information contained in this e-mail and any attached files with the 
permission of IMB.
###########################################################################################
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to