read&write lock example for thread
barrir example for thread synchronization