PDA

View Full Version : Posts not Immediately Appearing



Thray
2006-08-27, 12:25 PM
I have noticed that recently, the first post of a new page doesn't even appear until the second post is made. This has happened at least 3 times to me in the last few days.

Flabbicus
2006-08-27, 12:34 PM
Here's one example of a thread about this, couldn't find the one I started (http://www.giantitp.com/cgi-bin/yabb/YaBB.pl?board=news;action=display;num=1152159056)

Jack Squat
2006-08-27, 12:34 PM
I haven't looked into it, but my guess is that a race condition exists.

at the 14th post, two people start posting.

Person A hits post and Yabb sees that the current post count is 14.

Person B hits post and Yabb sees that the current post count is 14 (because the steps below haven't occurred yet).

Person A's post process writes the post entry. Then updates the thread header with a post count of 15 (14 plus one new one).

Person B's post process writes the post entry. Then updates the thread header with a post count of 15 (becasue it retreived a 14 before Person A's process had a chance to change it).

Now the thread has 16 posts (which would require a new page). But the header file only says 15 (so , no new page logic is executed).

This is just a guess. I haven't really spent any time looking at this issue, but it's consistent with the way YaBB works. I've seen other race conditions occur in this software, so I'm not terribly surprised.

Thray
2006-08-27, 12:43 PM
Ah. It was something I hadn't seen before, so I was curious. Thanks Rilik, Jack.

Jack Squat
2006-08-27, 12:46 PM
No problem It's not like I had anything important to do, except write an English paper. So I guess I should say thanks for helping me procrastinate :P