Tobias S. Josefowitz @ Pike developers forum wrote:
As to what exactly goes wrong... What I can report is that using that commit, it mostly works, until the scheduling gets tight. I.e. under intense pgsql query load, things go wrong. So that suggests that there might be issues that occur when
Hmm, curious. If we tried to reproduce this without pgsql though, what would we be looking for? Data going out on the Stdio.File being not what one would expect it to be? I.e. not a crash or so?
It did not crash. What happened was that the communication with the database got stuck. I.e. most likely cause would be that some of the add()s get lost.
Theoretically, something like this could reproduce it:
Stdio.File thesocket; Stdio.Buffer thebuf;
Thread A: Tight loop with: thesocket->write(thebuf);
Thread B: Tight loop with: thebuf->add()
Some of the add()s if thread B might get lost (race condition).