TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Jason Weill
from: Jonathan de Boyne Pollard
date: 1996-02-06 21:57:12
subject: batch files

JW>
  > I have a batch file, running in the background,
  > which looks for semafores created by my RemoteAccess batch
  > file when mail is entered.   [...]
  >
  > :Begin
  >           IF EXIST ECHO.SEM GOTO Echo
  >           IF EXIST NET.SEM GOTO Net
  >           IF EXIST INCOMING.SEM GOTO Importmail
  >           GOTO Begin
  >
  > Only problem is, it tends to slow down my system a bit
  > while waiting for mail.   [...]
  >
  > I'm pretty sure that there's a REXX solution to this.   [...]
JW>

  There *is* a REXX solution to this, and it's about the best solution
  that you can achieve.

  The solution is to use *real* semaphores, not flag files.

  OS/2 provides real semaphores, and there is at least one REXX extension
  package (called RXU) available on FIDONET files sites that allows you to
  control semaphores from REXX scripts.  You can thus write your REXX
  scripts to use event semaphores.

  The primary advantage to real semaphores is that your script will not
  poll *at* *all*, and will thus not consume any precious CPU time unless
  it actually has real work to do.  One secondary advantage is that real
  semaphores also don't require cleanup when your system is restarted,
  unlike flag files.

  BTW, don't let the welter of replies that you will receive telling you
  about SysSleep, DELAY, and timeslice release utilities distract you.  I
  don't want to sound cruel, but they are all completely irrelevant.  You
  can run DOS mail utilities from a REXX script (there's a slight
  difficulty with the environment, but you can always use secondary DOS
  batch files called from the REXX script to set environment variables
  where necessary), so you can still use REXX and real semaphores whether
  you upgrade your mailer or not.

  Go out and get RXU and give it a go.  If you have any problems with
  REXX, then ask here (or in the OS2REXX echo), and plenty of REXX experts
  will be glad to help.

  ( If you have mastered the intricacies of braindamaged DOS batch file
    programming necessary for DOS BBS work then REXX will be child's play
    for you, though.  (-: )

  > JdeBP <
___
 X MegaMail 2.10 #0:
--- Maximus/2 3.01
* Origin: DoNoR/2,Woking UK (44-1483-725167) (2:440/4)
SEEN-BY: 50/99 270/101 620/243 711/401 409 410 413 430 808 809 934 955
SEEN-BY: 712/407 515 517 628 713/888 800/1 7877/2809
@PATH: 440/4 141/209 270/101 712/515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.