Questions tagged [multithreading]
For questions regarding multi-threading, the ability of a computer or a program to perform work concurrently or asynchronously by utilizing multiple concurrent streams of execution (generally referred to as threads).
multithreading
140,609
questions
0
votes
0
answers
26
views
How to instantiate Singleton objects for other classes in a different class in Java?
public class Singleton {
private volatile static A AInstance = null;
private volatile static B BInstance = null;
private Singleton() {
}
public static synchronized A ...
-3
votes
0
answers
30
views
Designing a multi-threaded chat server [closed]
I am working on a small personal project to create a multi-threaded chat server using TCP sockets in C. I want to avoid the one-thread-per-client model as I already implemented that. I decided to use ...
0
votes
0
answers
18
views
Qt/QML - Getting *qml* stack trace from Non UI thread is always crashing
In a certain QML app there is a problem that sometimes QML scripts hang UI thread for very long times, like 20+ seconds of UI thread not processing any incoming events from any source. In rare cases ...
0
votes
0
answers
12
views
How to Immediately Cancel an Asyncio Task That uses the Ollama Python Library to generate an answer?
I'm using ollama to generate answers from large language models (LLMs) with ollama python api. I want to cancel the response generation by clicking the stop button. The problem is that the task ...
0
votes
0
answers
32
views
How to create a parallel program that reads different data
I'm trying to create a process that listens to three COM ports and process the data in parallel. The problem is that I have a machine that sends an ID and proceeds to do a test in one of the COM ports,...
0
votes
0
answers
45
views
How can I add parallelism to nested loops here?
I am currently developing a c++ minecraft clone in sfml and am trying to implement parallelism for rendering and modifying the chunks using a thread pool. The main issue I am currently facing is how ...
-2
votes
0
answers
19
views
What exactly happens when I spawn 5 workers using Gunicorn in PROD for Fast API? [duplicate]
So my understanding is that workers should usually be 2 * cores + 1. Lets suppose I have a 2 core machine and spawned 5 workers in a PROD instance.
How does it work under the hood ?
Does Fast API ...
0
votes
1
answer
46
views
Multi thread Automation scripts Selenium C# (Threads - 8). After sometime the CPU went to 100% utilization as the Edge browser is not getting closed
Selenium - C#
I triggered a multi-thread Automation scripts(200 scripts) (Threads - 8).
After some time the CPU went to 100% utilization as the MsEdge browser is not closing and it eats up all the ...
1
vote
4
answers
123
views
Is statement in C++, i.e., instructions ends with semi-colon ';', executed as a whole in multi-thread context?
Say I have a std::atomic called num:
std::atomic<double> num{3.1415};
as C++ does not completely support arithmetic operations for atomics except for "integral types", I cannot do:
...
3
votes
1
answer
76
views
When constructing a new std::thread, is there a point to wrapping the callable in std::bind?
I'm pretty unfamiliar with modern C++, but I've been looking at the Boost.Beast sample files and trying to understand how they work.
Specifically, I've been looking at this http server sample.
Here's ...
1
vote
1
answer
31
views
What causes inter-process communication to take millions of cycles?
In the best case, Inter-process communication is obviously slower than communication between threads, as threads share resources, such as the heap.
However, why is inter-process communication several ...
-1
votes
0
answers
37
views
Rust cdylib websocket fatal runtime error: global allocator may not use TLS
I'm writing rust dll, cdylib which supposed to start new thread and connect to websocket using tokio::tungstenite
i load dll reflectivly into rust program using https://github.com/indygreg/rs-memory-...
-1
votes
0
answers
25
views
Multithreading for Async function resulting into error in C# [duplicate]
I am new to this C# language.
I have function in which I need to call an async function multiple times on separate thread. After the debugger hits WaitAll() or WhenAll() both are giving me below ...
0
votes
0
answers
9
views
A Gunicorn + Flask + Nginx Application including Apscheduler blocks a new worker pid in Python application once in a while
While apscheduler scheduler service is running in parent PID meanwhile a new "Worker is booting up" after which, requests from nginx lands on this new pid (worker) and gets blocked it does ...
0
votes
0
answers
27
views
Python Thread Deadlock Issue
I have a Python script that reads all XML files in a specified directory, translates them using the Google API, and saves them in another directory.
Since the API is slow, I divide the XML into chunks ...