I am having some problem with a C project.
The situation is the following:
1. I have a main file which includes a file .h with static variables and another C file with all the functions (this also includes the file .h).
2. If I run the main it works fine, but I would like to run different instances on different shells so that I can exchange messages.
The problem is that both the processes are allocating the static variables in the same location of memory, so the operations done by the second instance will overwrite the ones of the first instance.
Hope I was clear, I'm not very proficient in C.
以上就是question on multiprocessing and static variables in C的详细内容，更多请关注web前端其它相关文章！