Help! Semaphores in Netware 3.11 
Author Message
 Help! Semaphores in Netware 3.11

I use CATools III to find out how many times my Clipper 5.2e program was
started in Netware 3.11. Namely, I use
nHandle := NNetSemOpn("myprog.exe")
to create or open the semaphore, then
NNetSemOpC(nHandle)
to find out how many times my program was started.
Everything is OK but from time to time the semaphore seems to be opened
although there is no more myprog.exe applications in Netware. So,
NNetSemOpC() returns 2, although there is only one application active.
How to solve that problem? Or, how it can be resolved without the use of
NNetSemOpn()? I should add that in the end I compare NNetSemOpC() return
value with the value which I save on the disk to check out if every
application was finished properly (every time the new user starts the
application it increments the counter and writes it on the disk; when the
application ends, it decrements the counter and saves it too).
Thank you!

Janusz



Sat, 14 Oct 2000 03:00:00 GMT  
 Help! Semaphores in Netware 3.11

Quote:

>I use CATools III to find out how many times my Clipper 5.2e program was
>started in Netware 3.11. Namely, I use
>nHandle := NNetSemOpn("myprog.exe")
>to create or open the semaphore, then
>NNetSemOpC(nHandle)
>to find out how many times my program was started.
>Everything is OK but from time to time the semaphore seems to be opened
>although there is no more myprog.exe applications in Netware. So,
>NNetSemOpC() returns 2, although there is only one application active.
>How to solve that problem? Or, how it can be resolved without the use of
>NNetSemOpn()? I should add that in the end I compare NNetSemOpC() return
>value with the value which I save on the disk to check out if every
>application was finished properly (every time the new user starts the
>application it increments the counter and writes it on the disk; when the
>application ends, it decrements the counter and saves it too).
>Thank you!

>Janusz

Why not do something like:  

nCurrentSemValue := NNetSemVal(nHandle)  
nValueToBe := nCurrentSemValue - 1

Do while  nValueToBe  <> nCurrentSemValue
        NNetSemWai(nHandle)     // decrement Netware semaphore  
        nCurrentSemValue := NNetSemVal(nHandle)         // get value
EndDo

This *should* ensure that the semaphore is really getting decremented.  There
is one gotcha with Netware semaphores however.  If a workstation crashes and
you do not have watchdog timers enabled on the server, the semaphore will hang
around until the workstation reboots.  This might explain why you have
"phantom" semaphores when you're sure you shouldn't.  Actually, its too bad
your using 3.11, versions prior to 3.11 used to allow a user to actually see
what semaphores were opened by what users (I think it was done with the
fconsole.exe program).  Novell saw this as a security breach and removed it as
of 3.11.  I've allways wondered if you got an old copy of fconsole whether it
would work on a 3.11 or 3.12 server.....  I suppose I could dig through my old
netware distribution disks and find out.  It would be an easy way for you to
figure out which workstation has the culprit semaphore.

Mark

**  Remove ".nospam" when replying or email will bounce back to you...



Sat, 14 Oct 2000 03:00:00 GMT  
 Help! Semaphores in Netware 3.11

Janusz,

as Mark wrote there is a tme out on the NetWare server,
I think its about 15 min. This should release semaphores
of crashed worlstations.

On the server screen you can see open files and you can see
_who_ whas has your main.dbf open.

There are some stand alone programs like whohas.exe.
For this you need console operator rights on your workstation.

There is a special novell f2-api to show
- GetconnectionsUsingFile      // who has main.dbf open
- GetPhysicalLocksByConnection // who has locked which        
                               // clipper record
- GetSemaInf                   // who has a sema. open

I have them as clipper functions for my projects,
may be I publish them sometimes in the future
(remember: console operator rights required!).

Norbert Sommer
SAP R/3 Technical Consultant (NT/Oracle)
Team OS/2 Germany

- Remove NOSPAM to mail me -



Sat, 21 Oct 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. migration of 5.2 clipper app from netware 3.11 to netware 5

2. Clarion 2.1 / Win95 / Netware 3.11 ?

3. login.exe for netware 3.11

4. VSE 3.11 (WINDOWS 3.11) with more than 16 MB

5. Netware Semaphores

6. Help: Clipper network behavior with WIN WG 3.11

7. HELP:disk full on novell 3.11

8. HELP: itcl2.0/2.1 for Windows 3.11 ?

9. Help problems under Win 3.11

10. Help problems under Win 3.11

11. fortran semaphore to C semaphore

12. VSE 3.11 and Inter-process communication

 

 
Powered by phpBB® Forum Software