What are the differences in processes sharing variables, memory pages or files? Is one safer than another?
Which programming language are you talking about?
You're probably looking for IPC (Inter-Process Communication). If you want your program to share information with another you could use pipe().
About memory pages, the kernel handles paging for you.