|Top Previous Next|
Threading is a tricky subject and should be consider an advanced feature of Girder. It is very easy to hang Girder up by improper use of the functions given below. Consider yourself warned!
This example simply prints "hello there". But it does so from a new thread. The next example is a bit more complicated. It protects a shared variable called "result" with a mutex and signals the main thread about a change to it by using a condition.
As you'll be able to see is that it will print "Thread result: 50000" correctly.