synchronization with C++ version