in reply to how to solve producer consumer problem in perl when threads are disabled
As others have already said here ... write the producer, then write the consumer, and connect the two with a shell pipe. The IPC magic, therefore, is handled simply and automagically by the pipe, which appears to each as a simple file, but which will block the reader if there is nothing to read and block the writer if there is nothing to write. Other variations on existing "Unix plumbing" allow for multiple producers and/or consumers to be piped-together. You implement a complicated solution, mostly by avoiding the complexity altogether!