Wednesday, December 07, 2005

Problems

here I will put different little exercices I find.

6th grade problem:
find all integral numbers which after substraction to 9999 give the same number without the last digit. for example:
abcde - 9999 = abcd
damn, it must be easy

Saturday, December 03, 2005

SuspendThread

as the msdn says SuspendThread is for debugging purposes and should not be used.
it may be tempting to use it to pause a worker thread for example but it might not be ok.
the worker thread can be in the middle of executing a CRT function which is thread safe, using sychronization.
if the worker thread is paused after the lock is done, trying to execute from another thread a CRT function, which uses the same syncronization access, might get to a deadlock.