If i have a process and within i create a thread, in which a function "whatever" runs ... can the function then recognize changes to a variable that is existing within the main process and if yes, how ?
Has it to be global, for instance, or do i have to pass a pointer or what do i have to do so far ?
It can't be that i'd have to use a pipe or other IPC, for then "Multithreading" would not be much different from "Multiprocessing", or ?
The answer is sort of. If a variable is modified, as long as both threads have some way of accessing it, then the function in the secondary thread will continue to act as if there is a change. This could be from it being a global variable, but it can also be through a pointer passed (if you think about it, the address space pointed to is what is being modified). Of course, you have to be careful and lock your threads and that variable accordingly using mutex's and the like, otherwise there could be problems like trying to write two things at once, or reading it as it is being written, or other complicated synchronization issues like that.