dev
ref implementation
better synchronization
dev: simpler semaphore
remove limitation
timing edit