Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!turnkey!orchard.la.locus.com!prodnet.la.locus.com!richg From: richg@locus.com (Rich Greenberg) Newsgroups: comp.lang.rexx Subject: Re: REXX message answerer that eats CPU time... Message-ID: <22331@dice.la.locus.com> Date: 27 Feb 91 20:04:14 GMT References: <91051.184002IO92203@MAINE.BITNET> <1991Feb24.195917.439@sol.UVic.CA> <1991Feb25.055633.18236@ccu.umanitoba.ca> Organization: Locus Computing Corp, Los Angeles Lines: 44 In article <1991Feb25.055633.18236@ccu.umanitoba.ca> umochock@ccu.umanitoba.ca (Russell Ochocki) writes: >>In article <91051.184002IO92203@MAINE.BITNET> IO92203@MAINE.BITNET (Scott Maxell) writes: >>> Does anyone have the code for a REXX EXEC file that answers >>>messages which could possibly be modified to 'eat' CPU time every >>>few minutes to keep a student account from being forced off the >Try this: > > do forever > sleep 25 /* I think this is 25 minutes, but sleep may take secs instead */ > "msg * *" > end There are several problems here. First, sleep 25 (which should be written as 'CP SLEEP 25') will be 25 seconds. 'CP SLEEP 15 MIN' (or a shorter time if needed by your system) should do the trick. The use of MSG is not the best way. After a few of these, your screen will fill and go into HOLDING status. Poof, no more terminal i/o until you press clear. (Only applies to a real or emulated 3270 type terminal.) If you are disconnected, terminal i/o is a nop. Most systems that have a similar limit go by having used some CPU time since the last check. To get around this, do forever This will wait for "some" minutes. x = time('R') The time(E) call and test will get 'CP SLEEP some MIN' you out if you press ENTER before if time('E') < some * 60 the some minutes pass. Otherwise there then exit is no way out short of #cp i cms. end (The time(E) will use up some CPU also.) The question is, "Why do you feel you need to do this". Getting rid of idle users reduces overhead for the active users. If you are going to be idle, just log off. You can log back on whenever you are ready to do something. Everybody suffers if you cheat. Mabe just a teeeeny bit if its just you, but if everybody cheats, . . . . . -- ------------------------------------------------------------------------- Disclaimer: The above writings are the ramblings of one human being and have nothing what-so-ever to do with Locus Computing Corp. ---> Rich Greenberg, richg@locus.com TinsleTown, USA