There is an obvious bug in the update function ~: (I have a simple program to test in case someone is not convinced): the update function performs the "getter" and "setter" operations sequentially; this is a critical section and should be protected by mutual exclusion in a multithreaded environment. V.