Category "multithreading"

Are floating point operations deterministic when running in multiple threads?

Suppose I have a function that runs calculations, example being something like a dot product - I pass in an arrays A, B of vectors and a float array C, and the

Jmeter - How to run the same thread group but with different properties consequentially using command line

What I want to achieve is: I only have one thread group and the only thing that changes are the Thread Properties I want to run more than one thread group sequ

Why ConcurrentDictionary TryUpdate() method requires indicating oldValue?

When calling TryUpdate you should specify old value besides key, why is it required ? And additional question why TryUpdate method (and others similar) have whi

Mutex does not work as I expect. What is my mistake?

I was trying to figure out the data race theme, and I made this code. Here we work with the shared element wnd. I thought that by putting lock in the while loop

How do I use a channel receiver inside a nested closure?

I want to share some data between an async function with another async function running on a separate thread. In this case it's a cronjob. This is the solution

Reentrant lock not updating the shared resource properly

I have a shared variable count, which I am incrementing in increment() method and two threads are access this. I'm getting the wrong final count. Here is the s

How to let threads manipulate the same list Java

I have an class where I define a list with an add and deletion method like here: public class listClass{ private List<T> someList = new ArrayList<&

why does the ObjectOutputStream throw the invalid stream header 000000 error?

the method receives a stream of bytes and returns an object of type Data. Everything works fine without threads. But when using threads, the method causes the i

How to avoid blocking the asyncio event loop with looping functions

I'm using FastAPI with WebSockets to "push" SVGs to the client. The problem is: If iterations run continuously, they block the async event loop and the socket t

sort .map data in react js (show latest date on top)

I am trying to sort data according to date where the latest date must come at top of the list let mapped = predefined.reduce((r, a) => { r[a.date] = [...(

Issue with nested functions, inheritance and multithreading in python

I'm trying to automatically take data from several websites. I defined a class class Site1Scraper: def __init__(self): ... def f1(self): ... def f2(

In Java how to synchronize cache read and write operations

I am working on implementing a simple cache using ArrayList in my application. I would like to synchronize cache update operations, while updating the cache I s

Python GUI with Multithreading - how to manage threads

I am new to Python. I have been trying to develop a GUI based tool to monitor a set of databases. I want to pull data with multiple threads to make the DB reads

How bad it is to lock a mutex in an infinite loop or an update function

std::queue<double> some_q; std::mutex mu_q; /* an update function may be an event observer */ void UpdateFunc() { /* some other processing */ std

Is there any way to kill a Thread?

Is it possible to terminate a running thread without setting/checking any flags/semaphores/etc.?

Executor pauses and doesn't process pending queues

I have a long-running task of creating a bitmap saving it and recreating more bitmaps which I was doing on a single background thread ExecutorService executor =

Develop a multi-threaded application. Don't use synchronized word [duplicate]

Free checkout. The fast food restaurant has several cash desks. Customers stand in line at a particular cash desk, but can move to another que

How to successfully implement Multiprocessing Lock?

I have been following the example synchronization-between-processes from the multiprocessing document. The script is as follows: from multiprocessing import Pro

Volatile reference to mutable object - will updates to the object's fields be visible to all threads

... without additional synchronization ? The Tree class below is meant to be accessed by multiple threads (it is a singleton but not implemented via an enum) c

Threading and Tkinter - How to use the threading module with my simple example?

I don't understand how to use the threading module properly. In this example I have two tkinter widgets, a button and a progress bar. The progress bar (configur