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
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
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<&
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
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
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] = [...(
I'm trying to automatically take data from several websites. I defined a class class Site1Scraper: def __init__(self): ... def f1(self): ... def f2(
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
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
std::queue<double> some_q; std::mutex mu_q; /* an update function may be an event observer */ void UpdateFunc() { /* some other processing */ std
Is it possible to terminate a running thread without setting/checking any flags/semaphores/etc.?
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 =
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
I have been following the example synchronization-between-processes from the multiprocessing document. The script is as follows: from multiprocessing import Pro
... 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
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
I'm using the below code to get an array of elements from list that sum to value. However, it only using 1 CPU. My PC has 64 cores so I want to use 100% CPU to
I'm trying to restart a subprocess if it crashes, but somewhy this loop just doesn't work. I've been wondering if that's even possible? def dont_stop(conv):
I'm trying to achieve a task that requires real-time interaction, for example: A message (response) is received - it needs to be acted on at the same time. I tr
I found that in Python 3.4 there are few different libraries for multiprocessing/threading: multiprocessing vs threading vs asyncio. But I don't know which one