3
votes
1answer
150 views

Cancelable thread worker

My goal was to create class, that can run external method in non blocking manner. Second requirement was to be able to abort method run if it is needed (i.e. running user script). I decided to do that ...
3
votes
3answers
535 views

Is this code OK, to thread safety and delegates?

I've created some code, in main class loop are generated numbers (0~100), and when is generated number > 20 its value is passed to the thread where is simulated some work with this number. Meanwhile ...
1
vote
1answer
1k views

Polling loop to run in a background thread

I came up with the idea of a small utility class that will poll some delegate until the response received meets some condition, upon which it will notify the main thread which can take the appropriate ...