Urgent.News

What's breaking now, across thousands of outlets.

Tech

How to create concurrent tasks in Java, done by those who care about resources and performance

Este post nasce de uma preocupação que tenho levado cada vez mais a sério: entender como cada parte do código realmente impacta o uso de recursos. Também tenho usado IA como ferramenta de estudo, principalmente para conseguir acompanhar tanta coisa nova sendo lançada sem perder o foco no que realmente quero aprender. Este e outros textos que venho escrevendo também servem como um compromisso…

Translated from Portuguese Read in Portuguese

A technology article discusses how Java's Loom project has improved resource usage in multithreading. The author notes that traditional thread pools can lead to inefficient resource usage when tasks are not properly synchronized. For example, in a payment authorization process, if one task fails, others may continue to run unnecessarily, consuming resources.

The article introduces the StructuredTaskScope feature, which allows tasks to be grouped and managed together, enabling the cancellation of related tasks when one fails, and reducing resource waste. This feature provides a more structured approach to concurrency, similar to the try-with-resources statement for resource management.

Written by urgent.news from Dev.to's report — not a translation of it. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Numbers Do Not Belong in the Model

A missing number gets noticed. A wrong one does not. That single asymmetry is why reading documents with a language model has to be treated differently from writing text with one.

  • Numbers in language models require special attention and treatment.
  • Multi-digit numbers often split into individual units during tokenization.
  • Recommended solution involves extracting numbers from raw document before model involvement.

RAG security: the retrieved document is now your attack surface

Cross-post. Original: stellarbytecapital.com/blog/rag-security Retrieval-augmented generation is the default way to make an LLM useful on your own data: fetch relevant documents, stuff them into the…

  • Retrieval-augmented generation introduces untrusted data into language models.
  • Malicious instructions in indexed sources can be executed with app authority.
  • Securing RAG pipeline requires access control, tainted data treatment, and output guarding.

More from Tuesday 1 September →