sample code to demonstrate multithreading programming issues