-
.so and top level static
I have a program that is invoked many times simultaneously. The program uses a dynamic library. In the library there is a top level static integer that I want to have a unique value for each invocation of my program.
Q: will the value of this integer be unique for each invocation of my program?
I've tried it and it seems to work but I would like to double check my results.
-
depending on the language.
In C, use a #define
in java. declare it static final
etc.
as long as you're using the language's method of making sure that the number doesn't get changed, it won't get changed.
starX
www.axisoftime.com
-
I am using C and the variable in the .so is a static int.
My program calls one of the functions in the .so and initialises it to a unique value. Then control returns back to the program. Then, I call a different function in the .so and use the value in the static int.
If another invocation of the program is using the same .so will it over-write the value in the static int?
Should I have posted this to the C board?