Small example of threaded programming