Friday, 15 January 2010

c - Take value of time as input from the user and adjust a delay equal to that time in multiple threads -


There are 20 threads running in my program. I have the time 't' (T) in each thread.

I have a single window on which there is an edit box, I want my user to enter the values ​​in that editing box and then I will assign all my threads to my sleep () according to that input Want to adjust

If all threads read directly the variable in which the value of the user is input, keep that copy of that variable and adjust your sleep time according to that sleep, will there be issues of synchronization?

No, only one thread writes the price, 20 others only read it. The issues of synchronization may occur when many threads write the value.

No comments:

Post a Comment