I wrote a locking class. I implemented two types of locking: via a semaphore and via a channel. Channel locking allows you to determine which process has acquired the lock and avoid a situation where a process locks itself. To test semaphore locking, run the code as is several times. Until the first running instances close, subsequent instances will be unable to acquire the lock. Interestingly, even if you close windows incorrectly by killing the process, the lock is still released. To test channel...
I need to monitor the time elapsed since the start of an operation. For testing, I implemented the following code: WaitingTime = 1*1000000 NUMERIC DIGITS 18 SemTimestamp=time('f') say 'time(e)='time('e') do forever if WaitingTime>0 then if (time('f')-SemTimestamp)>WaitingTime then do say '---'time('f')'-'SemTimestamp'='time('f')-SemTimestamp'>'WaitingTime say 'time(r)='time('r') say '<!> WaitingTime ERROR'; return end -- if if say '==='time('f')'-'SemTimestamp'='time('f')-SemTimestamp'>'WaitingTime...
I need to monitor the time elapsed since the start of an operation. For testing, I implemented the following code: WaitingTime = 1*1000000 NUMERIC DIGITS 18 SemTimestamp=time('f') say 'time(e)='time('e') do forever if WaitingTime>0 then if (time('f')-SemTimestamp)>WaitingTime then do say '---'time('f')'-'SemTimestamp'='time('f')-SemTimestamp'>'WaitingTime say 'time(r)='time('r') say '<!> WaitingTime ERROR'; return end -- if if say '==='time('f')'-'SemTimestamp'='time('f')-SemTimestamp'>'WaitingTime...
Can we expand on this? I have a program that created a semaphore and exited without deleting it. It exited, perhaps by mistake. The semaphore remains in the system, and the next time the program is launched, it goes into an infinite wait. Are there algorithms and methods for combating this? For example, so that when the process owning the semaphore closes, the semaphore is closed automatically.
Sorry for bothering you, I found it myself. The line should look like this. FileAray['!OLDITEMS']=OLDItems say FileAray['!OLDITEMS']['A']
Sorry for bothering you, I found it myself. The line should look like this. say FileAray['!OLDITEMS']['A']
Good day! I have a stem and need to add the contents of another stem to it. Can you tell me how to do this without a loop? An example, a vision of "how it should be." Of course, it doesn't work. OLDItems=.stem~new OLDItems['A']=1 OLDItems['S']=2 OLDItems['D']=3 OLDItems['F']=4 FileAray=.stem~new FileAray['!FILENAME']=FileActual FileAray['!OLDITEMS.']=OLDItems. say FileAray['!OLDITEMS.A'] I'd like to see "1" as the output.
Good afternoon! I'd like to clarify some information about the NUMERIC DIGITS scope. I have a class with several methods that call each other, like this: Class Method 1 use local Method 2 use local If I set "NUMERIC DIGITS 18" in "Method 1" and then call "Method 2," what will the precision be in "Method 2"? The same question applies without the "use local" command in methods, when class variables are not accessible within the method.