started working with shared mem and semaphores on threads.c