Operating System - OpenVMS
1753797 Members
6950 Online
108805 Solutions
New Discussion юеВ

Re: Problems with simple threaded program

 
SOLVED
Go to solution
Alex Chupahin
Super Advisor

Re: Problems with simple threaded program

Spasibo, Ruslan!
Eto tozhe vazhno.
Ruslan R. Laishev
Super Advisor

Re: Problems with simple threaded program

Hi, Alex!

Using link/thread=(upcalls[,mult]) is not essential for normal behaviour of threads. :-)
Hoff
Honored Contributor

Re: Problems with simple threaded program

If we're exchanging aphorisms, remember that thread-safe is an oxymoron. And that per-thread security probably isn't.

And slightly more seriously, having $hiber and $wake flying around in any application can snarl an AST-driven or a thread-based program.
Ruslan R. Laishev
Super Advisor

Re: Problems with simple threaded program

Agreed. :-)
GuentherF
Trusted Contributor

Re: Problems with simple threaded program

Without the LINK/THREAD=UPCALLS the the threads interfere with each others sleep(). Eventually one $WAKE is lost and the process hange in HIB. Check the return value from sleep(). It's not always 0 meaning the sleep() returned earlier. That's the $WAKE (part of the sleep() implementation) that finally is missing.

/Guenther
Hoff
Honored Contributor

Re: Problems with simple threaded program

Back when I was more regularly tossing $hiber and $wake calls and ASTs around (and this was back in the era when the debugger itself would interfere with $hiber and $wake), a periodic $schdwk was a handy thing to have chugging along in the background. This was a deliberately-induced spurious wake-up, and it did tend to unwedge things until you could figure out what really happened.

(This all seems so primitive now. Ah, well.)

Willem Grooters
Honored Contributor

Re: Problems with simple threaded program

$HIBER / $WAKE in a multi-threaded program: Isn't that asking for trouble? IIRC, it used to be discouraged; but things may have chnaged in the years...
Willem Grooters
OpenVMS Developer & System Manager