Original Post
🔒 Locked
MultiThreading - unsure
Advertisement
each thread will have their own count
as long as count is definded in the function like you have it
now if count was declared global then of course all the threads would be using the same count and you would get some messed up stuff going on, or maybe not messed up if that is what you were looking to do
"I pity the fool, thug, or soul who tries to take over the world, then goes home crying to his momma."
- Mr. T
as long as count is definded in the function like you have it
now if count was declared global then of course all the threads would be using the same count and you would get some messed up stuff going on, or maybe not messed up if that is what you were looking to do
"I pity the fool, thug, or soul who tries to take over the world, then goes home crying to his momma."
- Mr. T
Yes, "count" will be different. But "cout" won''t, so you''ll probably get an output salad.
Forever trusting who we are
And nothing else matters - Metallica
Forever trusting who we are
And nothing else matters - Metallica
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement