Consider a function that takes array of 100 data elements does something prints those to console.
Now say I launch two threads of the function on a multicore machine. Since it's a multicore machine there is good probability that two threads run on two cores. Since both of them need to display data there's a race for console window.
Now how is the console shared between the threads.?
The one which reaches the std::cout
first gets to display entire data, stalling other thread .?
or Is the console window time shared between threads.? if so what determines the amount of time sharing by the threads .?