Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
3 Views

Naming Module shared data section to exclude sharing unshared data

Jump to solution

In MSVC there is the

#pragma data_seg("sdata")
//....
#pragma data_seg()
#pragma comment(linker, "/Section:sdata,RWS") 

that lets you only share that data section and only that section in a dll. I was trying the module example in   DLL_Shared_Data with the module data being in ".data" with /section:.data,RWS. In my anticipated code, there would be unshared data in it as well, and I was worried how to keep separate as that private data may be put in ".data".   

0 Kudos

Accepted Solutions
Highlighted
Black Belt
3 Views

I don't think there's a way

Jump to solution

I don't think there's a way to do this in Intel Fortran. However, my usual advice for sharing data cross-process in a DLL (that's what the linker directive is for) is to put the data you want shared in its own module and build that module into a DLL. Have other code that wants to use that shared data link to that DLL.

Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran

View solution in original post

0 Kudos
3 Replies
Highlighted
Black Belt
4 Views

I don't think there's a way

Jump to solution

I don't think there's a way to do this in Intel Fortran. However, my usual advice for sharing data cross-process in a DLL (that's what the linker directive is for) is to put the data you want shared in its own module and build that module into a DLL. Have other code that wants to use that shared data link to that DLL.

Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran

View solution in original post

0 Kudos
Highlighted
Beginner
3 Views

So if I had to use fortran

Jump to solution

So if I had to use fortran for such, I would need two dll's one private and  one shared data?

0 Kudos
Highlighted
Black Belt
3 Views

Yes, I suppose that is true.

Jump to solution

Yes, I suppose that is true.

Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran
0 Kudos