Thread: .so and top level static

  1. #1
    Registered User oomakoo's Avatar
    Join Date
    Dec 2001
    Posts
    8

    .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.

  2. #2
    Registered User
    Join Date
    Aug 2001
    Posts
    202
    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

  3. #3
    Registered User oomakoo's Avatar
    Join Date
    Dec 2001
    Posts
    8
    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?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Inserting a swf file in a windows application
    By face_master in forum Windows Programming
    Replies: 12
    Last Post: 05-03-2009, 11:29 AM
  2. Multiple Top Level Windows
    By quark_77 in forum Windows Programming
    Replies: 0
    Last Post: 07-13-2008, 02:32 PM
  3. Taskbars; 'Cannot create top level child window'
    By Gerread in forum Windows Programming
    Replies: 4
    Last Post: 05-18-2007, 06:41 AM
  4. Dialog window with top level menu
    By Frandy in forum Windows Programming
    Replies: 2
    Last Post: 09-22-2004, 10:53 AM
  5. Stack functions as arrays instead of node pointers
    By sballew in forum C Programming
    Replies: 8
    Last Post: 12-04-2001, 11:13 AM