Threads are similar to processes. Threads, like processes, are time-sliced by the kernel. On uniprocessor systems the kernel uses time slicing to simulate simultaneous execution of threads in much the same way it uses time slicing with processes. And, on multiprocessor systems, threads are actually able to run simultaneously, just like two or more processes can. Well, threads share the same memory space.
Independent threads can access the same variables in memory.
So all of your program's threads can read or write the declared global integers. There is no one simple answer to this problem. It often dramatically increases the complexity of your program. If you've ever had to make massive modifications to one of your programs so that it supports IPC, you'll really appreciate the simple memory-sharing approach that threads provide. With a little synchronization, all your threads can read and modify your program's existing data structures.