Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Making FORTRAN libraries thread-safe?

FORTRAN Libraries thread-safe
0
Posted

Making FORTRAN libraries thread-safe?

0

“James D. Clippard” wrote: > I have a need to use several libraries originally written in FORTRAN as part > of a numerically intensive multithreaded application. The libraries are > currently “wrapped” with a C/C++ interface. > > —– > My question is: How might one safely accomplish such a task, given FORTRAN’s > non-reentrant static memory layout? > —– The answer is really “it depends”. Firstly, with multi-threading you are going beyond the bounds of what is possible in standard C/C++, so any solution is by definition system dependent. I’m not sure off hand if any version of FORTRAN (eg 90 or 95) has standardised support for threading, but somehow doubt it. F77 never had any standardised support for multi-threading. Second, “FORTRAN’s non-reentrant static memory layout” is not strictly true. It is definitely not true with F90 or F95. With F77 (and before) things are a little ambiguous — eg lots of vendor specific extensions — so you will need to look at documentation for your

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123