add thread some problems with multiple writes

Signed-off-by: Andrea Corna <andrea.corna.ac.91@gmail.com>