Closed MattJaniszewski closed 9 years ago
:+1:
@MattJaniszewski: :+1:
Would you mind removing the PSR-2 commit (or moving it to another pull request) so that this pull request is limited to the shared memory change?
I rebased this branch, and removed all the un-related modifications. I created separate branches for them, and I'll create the pull requests later (so they will end up being fast-forward merges).
I ran into a limit when the FIFO pipe would get full (> ~62k of data), and cause the child processes to block until the pipe was cleared (e.g., by running the
cat
command in the appropriate FIFO handle on the file system). The use of theshmop_
functions seemed like a good alternative.In the PR, I added a unit test which re-creates the problem that kept the original version from working on a typical Linux system.
One thing I will note is that while I did all the due-diligence I could with the
shmop_
functions, I had to end up using@shmop_open
with the error suppressor operator twice, to test for the presence for an existing memory segment. It's not ideal, but seemed like the only way.A decent way to test that there are no left-over open memory segments is to run
ipcs -m
on the Linux system. You can then pass any offendingshmid
value over to theipcrm
binary. My testing as of yet indicated no issues of this kind, but it's theoretically possible it can happen in some edge-cases.