I’ve got two programs – one of them is generating some data and put them into FIFO and the other one reads this data from FIFO and do something with them. How to limit number of reading programmes? I’ve think of limiting FIFO’s size or checking how many data is inside, but i haven’t found anything interesting. Thanks for your help.
Share
A fifo pipe is a system file and so the only way you can control access to it is by the usual means (ownership and permissions). But see also
man flock. File locking is not enforceable on linux, ie, you can ignore it, but if you implement your readers to obey file locks, then problem solved.So: if the problem is unwanted and intrusive accesses, use ownership and permissions to prevent this. Otherwise, use file locks.