About the second-kill program
The current idea is this:
When the user participates in the second kill and then inserts all the users into the database, and then polls the time by polling until the timer is zero, which is the second kill,
Polling time is one second, the problem is that if there is a second time to the last second to kill the user, then to let the counter overtime, and then continue polling,
Don't know why not reasonable!!!
Please, everyone, for your sake! Thank you
Share to:
------Solution--------------------
No, to the time, lock live not on the line, but also let the inquiry what ah!
------Solution--------------------
Yes, when the time is up, the lock table is banned.
Then the stack of ideas, the last one inserted for the winning bidder.
If the last-minute bidder has more than one person, the poll
(In fact, personally, the poll is not, direct ORDER by DESC to the MySQL processing query)
------Solution--------------------
Listen to your second kill, seemingly only a second out of one?
If so, I must have a start time countdown, when the time to allow the purchase, when the purchase of storage when the query has been bought by someone, one but the first person to place a single, then stop buying.
Isn't that okay?
------Solution--------------------
citation:
Wow, that makes sense, but I don't think it's fair enough.
Pay attention to fairness and justice
Last-minute buy without concurrency, only one person wins the bid, the fairest.
Have concurrent many people win the bid, can not say fair, you say to who bid good? Not one of Rand's random ones, which is not fair to anyone else. This is more than a Rand process, rather than direct order by, let MySQL decide.
------Solution--------------------
and by setting the insertion time to microseconds (1 seconds = 1 million microseconds), I don't believe I can have concurrency.
If there is still concurrency, your station has been very NB, it is impossible to come here to ask, around already have a large number of engineers.
------Solution--------------------
Reference:
also set the insertion time to microseconds (1 seconds = 1 million microseconds), I do not believe there can be concurrency.
If there is still concurrency, your station has been very NB, it is impossible to come here to ask, around already have a large number of engineers.
Hahaha ...