Risk of flooding acorss Essex as thunderstorms and heavy rain to hit county
Risk of flooding acorss Essex as thunderstorms and heavy rain to hit county
Pictures show lorry fire at service station close to Stansted Airport
Beijing threatens Trump over Iran sanctions and says it will strike back at US if China suffers
Are your renovations reducing the value of your home? Expert reveals the 21 'cheap, dull or awkward' refurbs that leave buyers 'mentally pricing up how much it's going to cost to undo'
Baby food pouches shouldn't be given to newborns, experts say
Abandoned vehicles and rubbish piles left behind by travellers who set up illegal camp in 'land grab' on green belt site near village over Easter bank holiday weekend
Southend woman expelled from school at 14 is now a millionaire
Michael Owen's wife Louise reveals her guilt at the footballer leaving Real Madrid after just one season because she was lonely and wanted to go home
Austin Metcalf's father admits he 'feels sorry' for Karmelo Anthony after his retrial bid was shot down
RUTH SUNDERLAND: Near-collapse of AI hedge fund is a scary trip down memory lane
Tax older generation more to boost the public purse, Left-wingers urge Labour
Dolly Parton looked energized and relaxed in final public appearance just 11 days before her death
SpaceX Plans to Build a $100 Billion Spaceport In Louisiana
Read more of this story at Slashdot.
Strictly pro Kristina Rihanoff stuns in a black bikini as she hits the beach with lookalike daughter Mila, 10, on family trip to Florida
160-year-old Devon tungsten mine to reopen after government funding boost
Vistry shares surge after it receives £350m government affordable homes funding
CodeSOD: Lock 'Em Dead
Kevin sends us an exception handler from C++. Let's see if we can spot what's going wrong:
catch (Exception::Deadlock) { retry; }When we catch a deadlock happening, we retry. That's not a keyword in C++, and looking at how it's used, it has to be some kind of macro, and I suspect that the macro is hiding a goto underneath it.
The real problem, though, is that we suspect we're in a deadlock situation. That means this thread is waiting on a resource held by another thread which is waiting for a resource held by this thread. Neither train may continue until the other has passed. So this retry only works if it releases the resource held by this thread (letting the deadlocking thread proceed). But does it?
Not according ot Kevin. The code already had a pile of deadlocks in it, so they brought in a highly paid consultant to try and fix them by reordering access and tracing where mutexes were causing issues. This retry just jumps back up to the top of the block, without releasing any resources. It "seems the consultant wanted to add some deadlocks of their own," Kevin says.