Putting an integer counter in shared memory and incrementing it for each message works on most platforms.
You have the overhead of polling the shared memory periodically, though.
If this is just sending messages to a central log server process you might find msgsnd and msgrcv more efficient without being too difficult to use. For a more general case, you might want to use the semaphore operations in IPC::Semaphore. | [reply] |