❌

Reading view

Многопоточность в Rust: как Ownership, Send и Sync помогают бороться с гонками данных

В предыдущей статье мы разобрали гонку данных в C++: десять потоков увеличивают общий счётчик, но без синхронизации программа может работать некорректно.

Теперь решим ту же задачу на Rust.

Разберём, как модель владения и система типов помогают предотвращать небезопасный доступ к общим данным, зачем нужны Arc, Mutex и AtomicUsize, а также какую роль играют Send и Sync.

На практических примерах сравним независимые вычисления, совместное изменение состояния и ожидание событий через Condvar.

Отдельно поговорим о том, чего Rust не гарантирует автоматически: логические ошибки, взаимные блокировки и проблемы координации потоков всё ещё требуют внимания разработчика.

Это продолжение серии о системном программировании на C++ и Rust — с кодом, разбором механизмов и практическими выводами.

Читать далее
  •  

Fallon Sherrock pulls off shock defeat of world darts No 1 Luke Littler in live TV battle

The 15th amateur to challenge Littler in Netflix stream on Friday evening, Sherrock was ‘lost for words’ after winning £501,000 prize

The name of the programme was Beat Luke Littler and Fallon Sherrock did just that.

On one of the biggest nights of the year for British TV, Netflix, too, there was much at stake: not just £501,000 to any of the 20 amateur challengers who managed to beat Littler in a single leg of darts, but also the jeopardy of whether audiences would choose to watch the streamer’s first UK live entertainment event – or the final of BBC juggernaut The Celebrity Traitors.

Continue reading...

© Photograph: Tom Dymond/StillMoving.Net for Netflix/Shutterstock

© Photograph: Tom Dymond/StillMoving.Net for Netflix/Shutterstock

© Photograph: Tom Dymond/StillMoving.Net for Netflix/Shutterstock

  •  

Pick Another Protein? Americans Still Want Beef, Despite the Price.

After chicken, consumers are buying more beef, while pork, turkey and soy products remain flat.

© Sandy Carson for The New York Times

Americans increasingly want their protein through high-quality beef.
  •  

From This City Is Ours to Macklemore’s Free Palestine tour: the week in rave reviews

The most fractious family in organised crime return while the US rapper embarks upon a series of benefit shows with some A-list guests. Here’s the pick of the week’s culture, taken from the Guardian’s best-rated reviews

Continue reading...

© Composite: BBC

© Composite: BBC

© Composite: BBC

  •  

‘They cheer like it’s football’: Celebrity Traitors fans hit bars to watch climax

One south London bar provided Claudia Winkleman-themed cocktails and its very own banishment ceremony

Cries, cheers and boos emanating from pubs across the country on Friday night were less likely to be linked to any sports fixture than the nation coming together for the dramatic climax of the BBC’s The Celebrity Traitors.

The cloak and dagger reality show, in which contestants attempt to deceive or deduce who among them are “Faithfuls” and “Traitors” for a charity cash prize, drew in more than half of the UK’s TV audience in its debut episode earlier this month.

Continue reading...

© Photograph: Andy Hall/The Observer

© Photograph: Andy Hall/The Observer

© Photograph: Andy Hall/The Observer

  •  

Осколки прошлого. Часть 2. 30 фактов из игровой индустрии за — 3 декабря 1994 года +

Сегодня у нас 31.10.2026, как следствие на этот раз временные рамки были ограничены диапазоном от 1.01.1970 до 31.10.2006. Выбор пал на 3 декабря 1994 года.

Читать далее
  •  

‘We’re not freaks’: police raid sparks concern for Taiwan’s LGBT-friendly image

The rounding up of customers at a gay bar weeks before Saturday’s Pride festival has some questioning the island’s progressive image

Josh was having a drink at Commander D, a popular gay bar in Taipei, on a Saturday afternoon when several police officers suddenly burst in. “Squat down and don’t move,” they shouted. Bewildered, he looked around to see the bar owner being handcuffed and forced to his knees.

The 28-year-old was among 51 customers to be rounded up and taken away for questioning over suspected breaches of public decency rules.

Continue reading...

© Photograph: Daniel Ceng/EPA

© Photograph: Daniel Ceng/EPA

© Photograph: Daniel Ceng/EPA

  •  

Minnesota Declined to Buy a Prison for $75 Million. D.H.S. Paid $495 Million.

The recent purchase of the prison to hold immigrants is among the acquisitions facing scrutiny in the Trump administration’s mass deportation push.

© Tim Evans/Reuters

The Prairie Correctional Facility was purchased by the Department of Homeland Security to serve as an immigrant detention center in Appleton, Minn.
  •  

Prosecutors Suggest They May Seek Additional Comey Charges

At a hearing in federal court, prosecutors defended an unusual, 11th-hour criminal case accusing the former F.B.I. director of leaking classified information a decade ago.

© Monica Jorge for The New York Times

During President Trump’s second term, the Justice Department has pursued James B. Comey without pause.
  •  

I read Anthropic's 92-page risk factor document, so you don't have to – video explainer

Anthropic, the creator of Claude, filed to go public on the US stock market on 26 October. The company's filing statement contains a 92-page risk factor document in which it acknowledges the dangers that AI poses to society and human beings, and factors that could negatively affect Anthropic's business. Johana Bhuiyan, senior tech reporter for the Guardian, breaks down the document and explains why Anthropic's IPO could be a real test to the AI boom

Continue reading...

© Photograph: NurPhoto/Shutterstock

© Photograph: NurPhoto/Shutterstock

© Photograph: NurPhoto/Shutterstock

  •  

Judge Appoints Special Master to Determine if Trump Officials Lied in Golf Course Suit

Judge Ana C. Reyes said an outside investigator would help determine whether parks officials or Justice Department lawyers withheld plans for Washington’s East Potomac Park.

© Doug Mills/The New York Times

A federal judge on Friday called for an investigation into whether the Trump administration concealed its plans to renovate a public golf course at East Potomac Park.
  •  

Florida prosecutors drop felony charge against Rick Ross in domestic violence case

Miami-Dade officials drop charge of battery by strangulation against rapper due to ‘insufficient evidence’

Florida prosecutors on Thursday dropped a felony charge against rapper Rick Ross nearly a month after he was arrested in Miami Beach when a woman he was living with told police he hit her, court records said.

The Miami-Dade state attorney’s office filed paperwork on Thursday to drop a felony charge of battery by strangulation because of “insufficient evidence”. Ross, whose legal name is William Roberts II, still faces a misdemeanor charge of battery domestic violence.

Continue reading...

© Photograph: Gilbert Flores/Variety/Getty Images

© Photograph: Gilbert Flores/Variety/Getty Images

© Photograph: Gilbert Flores/Variety/Getty Images

  •  
❌