Solved

static variables in threads

Posted on 2006-10-18
1
209 Views
Last Modified: 2010-04-15
If a static variable is declared within a function that is called by multiple threads, I would think the static variable would be shared among threads - e.g. it is not thread safe.  Am I correct about this?
0
Comment
Question by:chsalvia
1 Comment
 
LVL 45

Accepted Solution

by:
sunnycoder earned 50 total points
Comment Utility
Hi chsalvia,

Yes you are correct.

Cheers!
sunnycoder
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now