If you are targeting Linux you should probably prefer POSIX IPC to all the funky SysV weirdness involving ftok(3). The same holds for any OS that implements POSIX IPC correctly. Unfortunately, BSD derivates usually have POSIX IPC implemented as a thin wrapper in libc which makes the synchronization primitives usable either between threads or between processes and not both at once (and thus unusable for most interesting applications).