Multi-Thread public variables...

F

fachero1

How Can I set a public global variable whos value can be accessed by
any thread? not just by one thread but by all?...

Currently from what I see and understand if a thread is created the
global variable becomes locked or something like that...

how can I do this? in my case this would be totally safe to do ^.^
thanks
Jonathan
 
V

Victor Bazarov

How Can I set a public global variable whos value can be accessed by
any thread? not just by one thread but by all?...

(a) Threads are off-topic. Try comp.programming.threads.

(b) Global variables are usually accessible by all threads. There is
nothing you need to do different from just defining it/them.
Currently from what I see and understand if a thread is created the
global variable becomes locked or something like that...

Unknown in C++. Not topical.
how can I do this? in my case this would be totally safe to do ^.^

Try asking in comp.programming.threads.

V
 
J

Jim Langston

How Can I set a public global variable whos value can be accessed by
any thread? not just by one thread but by all?...

Currently from what I see and understand if a thread is created the
global variable becomes locked or something like that...

how can I do this? in my case this would be totally safe to do ^.^
thanks
Jonathan

Two things:
Ask in comp.programming.threads
Google and otherwise research mutexes and other such locking mechanisms.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top