Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29389 Discussions

threadprivate common-block for non-openmp thread

Tobias_Loew
Novice
675 Views

Hi,

I've got a FORTRAN dll that was made multi-threading-safe for openmp-threads by adding threadprivate-pragmas for all common-blocks.

Now, I'm trying to use this library in a multi-threaded environment, were the thread are NOT openmp threads. Is there any possibility to force allocation of the thread-local-memory for the common blocks and usage of thread-local-memory for those threads?

regards

Tobias

0 Kudos
2 Replies
Steven_L_Intel1
Employee
675 Views

Not that I know of.

0 Kudos
ZlamalJakub
New Contributor III
675 Views

Only way how to have some private data of thread is described here: http://msdn.microsoft.com/en-us/library/windows/desktop/ms686997%28v=vs.85%29.aspx In this case You should rewrite code to use data structure containing all module data and allocate space for it.

Another possibility (without rewritting your code) is to make copies of Your dll (each thread = one dll with different name) and create different threads with different copy of dll. In this case each dll will have access to its own data.

0 Kudos
Reply