[Qt-interest] QThread Problem

Andre Somers andre at familiesomers.nl
Tue Feb 16 09:03:26 CET 2010


Yuvraj wrote:
> Sonic wrote:
>   
>> On 02/15/2010 06:12 PM, Yuvraj wrote:
>>   
>>     
>>> Sonic wrote:
>>>     
>>>       
>>>> If one thread does a scanf and is waiting for user input, and if 
>>>> another thread does a scanf, what do you expect to happen?
>>>>
>>>> Syam 
>>>>       
>>>>         
>>> if one thread is waiting for user input also ,next thread has to be 
>>> running
>>>
>>>     
>>>       
>> Yuvraj, I'm asking what should happen if both threads make calls to 
>> scanf at the same time.
>>
>> Syam
>> _______________________________________________
>> Qt-interest mailing list
>> Qt-interest at trolltech.com
>> http://lists.trolltech.com/mailman/listinfo/qt-interest
>>
>>
>>   
>>     
> only sub -thread is  running. This one I  conclude from the printf 
> statements.
On your system. With you as user. Now. In your current location. With 
this moonphase.
There is *no* *guarantee* *whatsoever* that this will be the same if any 
of the above, or anything else, changes, unless you have specific thread 
synchronization systems in place for protecting these resources. In any 
other case, you're playing russian roulette in your program.

André




More information about the Qt-interest-old mailing list