[Info-vax] pthread_kill() replacement for VMS?

John Reagan xyzzy1959 at gmail.com
Fri Jul 28 15:47:11 EDT 2017


On Friday, July 28, 2017 at 1:20:33 PM UTC-4, David Froble wrote:
> John Reagan wrote:
> > On Friday, July 28, 2017 at 10:58:53 AM UTC-4, Stephen Hoffman wrote:
> >> On 2017-07-28 00:18:07 +0000, David Froble said:
> >>
> >>> Well, I guess that would depend on the multi-tasking being performed, 
> >>> and such.   Sure, an OS provides for multiple processes.  However, a 
> >>> single process may need to control and coordinate multiple "things".
> >> Distributed job schedulers have made that effort easier, and with less 
> >> bespoke code necessary.   DLM and termination mailboxes and TCP and the 
> >> queue manager are all good tools and can be useful here, but adapting 
> >> those pieces and frameworks to scheduling is a fair amount of bespoke 
> >> code.  But processes and process scheduling and distributed schedulers 
> >> are different from threading, and threading is something that really 
> >> doesn't exist in BASIC short of KP Threads or such.  I've yet to 
> >> encounter threaded BASIC code.   Lots of AST-based code and 
> >> multiple-process code written in BASIC certainly, but not threading.
> >>
> > 
> > The BASIC RTL is not thread-safe.  There is something in the BASIC release notes about it.  I don't think the COBOL RTL is thread safe either.  I don't about Fortran.  I know the Pascal RTL IS thread safe since I did that work and I know a few Pascal customers that use threading with Pascal.
> > 
> 
> No, VAX/DEC Basic doesn't support threads.
> 
> Since I've spent time there, I won't know nearly as much about using threads as 
> some might.  With one exception, and my ignorance, I think there may have been 
> only one time when the use of threads would have been helpful.  Mainly, I don't 
> miss the capability.
> 
> But since you've posted here John, can I ask, what type of effort is involved in 
> implementing threads in a compiler / language?  Or, would it be easier to start 
> over.  Would allowing threads then disqualify some other things the language 
> supports?
> 
> Could VAX/DEC Basic be modified to support threads, if you've looked at it 
> enough to take a guess?
> 
> Not looking for anything, just curious.

The compiler doesn't particular care but then we don't support any of the TLS that can use on Linux boxes.  I'm lobbying hard for TLS support for x86 especially since clang/LLVM understand it.

For the RTLs, there is just lots of static data that assumes that it can be manipulated just by disabling ASTs for a period of time.  That isn't enough for pthreads() and the like if you enable upcalls and multiple kernel threads.  Those are off by default today, but I'm also lobbying for them to be turned on and stay on - a 'mandatory default' to coin a phrase :)

For the Pascal RTL, there is a single data structure to track open files.  If multiple threads are opening/closing files, that linked list needs to be guarded.  You can use locks or some atomic flag or TLS services etc.  For the BASIC RTL, we looked several years ago and it is chocked full of static data structures that would need to be turned some per-thread or at least have some atomic access implemented.



More information about the Info-vax mailing list