Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
83 views

Let's say I have a CPU with 1 core and 2 hardware threads (for example, with Intel Hyper-Threading or AMD SMT). From what I understand, that means the core can run two software threads "at once&...
ab55's user avatar
  • 38
2 votes
1 answer
71 views

In this example, Tkinter GUI starts ThreadPoolExecutor. But ThreadPoolExecutor is inside a threading.Thread function. The thread function says it's finished before ThreadPoolExecutor has started ... ...
Rhys's user avatar
  • 5,418
0 votes
1 answer
68 views

I have a python script that pings another device every so often. PING_SIZE = "1" PING_RETRYS = "1" while True: try: result = subprocess.run( ["ping&...
Thewafflication's user avatar
-1 votes
1 answer
126 views

LISTING 7.21 ExecutorService that keeps track of cancelled tasks after shutdown. public class TrackingExecutor extends AbstractExecutorService { private final ExecutorService exec; private ...
Flamer's user avatar
  • 61
1 vote
1 answer
77 views

I am working on a Rust project (as a side-training project) to implement a HEIC (Apple iPhone picture format) to JPEG converter. Full code is already available here. Within this project I am trying to ...
AlexTorx's user avatar
  • 805
0 votes
0 answers
100 views

I'm learning about multithreading in Python, and am experimenting to see how GIL(Global Interpretor Lock) works. Given the following python code: def cpu_bound(): i = 0 for _ in range(10000000): ...
kienpham's user avatar
0 votes
1 answer
85 views

I am working with a third party library that calls a method using ThreadPool.QueueUserWorkItem(). However, an exception is occurring within that method and I'd like to know how to best handle it in my ...
komodosp's user avatar
  • 3,704
3 votes
0 answers
138 views

This is for Java 23, but I've replicated this on Java 21 and 17 as well. I recently ran a benchmark to compare performance differences between threadpools and parallelstreams for some simple ...
Andorrax's user avatar
  • 123
0 votes
1 answer
117 views

What is the actual practical advantage of using a scoped_session vs a normal session when using a contextmanager to handle opening and closing of the session at the appropriate times? In the following ...
Jan-Pieter's user avatar
3 votes
2 answers
143 views

I have legacy codebase that is starving ThreadPool because of many sync calls (instead of using async/await). I am trying to create background process that will prolong kubernetes lease due to ...
Mayo's user avatar
  • 949
0 votes
0 answers
83 views

I'm working on a Java application where I need to periodically check a MongoDB collection (CacheBilgi) and enqueue new data into a concurrent queue (cacheInfoQueue). Then, I need to process this queue ...
Requiet's user avatar
  • 85
1 vote
0 answers
109 views

I'm working on implementing concurrent third-party API calls for items in a list using CompletableFuture in Java. Instead of processing these requests sequentially, I want them to be executed ...
séan35's user avatar
  • 1,062
1 vote
1 answer
346 views

I am trying to work on some understanding on thread pools and am trying to implement one by myself without using the ExecutorService. But getting into waiting state for some reason and I am not sure ...
Vinod Krishnan's user avatar
3 votes
1 answer
189 views

The basic problem lies in the implementation of the RTL library as soon as the ThreadPool destructor collides with the FreeLibrary limitations. TThreadPool.Destroy has a fix to address this issue, ...
Igor Kaplya's user avatar
1 vote
1 answer
274 views

Issue with Virtual Threads in IntelliJ Debugger When using virtual threads in IntelliJ, the thread name is not displayed correctly in the debugger, even when explicitly set. Instead, it shows a ...
Kobra's user avatar
  • 1,378
1 vote
1 answer
89 views

I am a novice in C programming, a topic I am currently learning about is threading and multiprocessing. Using the api provided via pthread.h, I am implementing a priority thread-pool. It uses a heap ...
mak_7's user avatar
  • 31
0 votes
2 answers
200 views

I'm working on ASP .NET Core project, where I have classes managing a pool of worker threads for task execution, and I'm using the .NET thread pool to handle and execute tasks for processing incoming ...
Yassine Zakhama's user avatar
0 votes
1 answer
47 views

I was going through OSTEP's concurrency-mapreduce project which essentially involves building a toy MapReduce program which runs on a single machine using multiple threads. Towards the end, of the ...
Box Box Box Box's user avatar
1 vote
1 answer
185 views

I am trying to implement multithreading in Delphi 10.4 (Sydney). I am using TTask to run tasks concurrently and TThreadPool to limit the simultaneously running threads. Here's my code: var ...
Shweta Softwares's user avatar
1 vote
2 answers
274 views

I have been working with Delphi for some time, and am now trying to implement multi-threading in my code with the following requirements: Only 2 threads should run at a time. Other tasks should wait ...
I'mSRJ's user avatar
  • 341
0 votes
0 answers
152 views

Here is my code, if I enabled async_mode=True, I will get Traceback (most recent call last): File "/root/tradebot-pro/example/test_log.py", line 28, in <module> logger1.info(&...
river7816's user avatar
0 votes
0 answers
70 views

I create an LDAPConnectionPool the following way: LDAPConnectionPool( connection, 1, 20, StartTLSPostConnectProcessor(getSslContext()), ).let {...
gstackoverflow's user avatar
2 votes
1 answer
176 views

I'm reading the french book "Maîtrisez Qt 5: guide de développement d'applications professionnelles" to learn Qt. There is a small code in it to explain QThreadPool : #include "MaTache....
kingsjester's user avatar
4 votes
1 answer
242 views

I am experiencing a rare issue where SetThreadpoolTimerEx does not invoke the callback function as expected. Environment: Operating System: Windows 10 22H2 (Build 19045.5131) Visual Studio: 2022 (...
user2440195's user avatar
0 votes
2 answers
520 views

I want to use ThreadPoolExecutor to parallelize some (legacy) code with database access. I would like to avoid creating a new database connection for each thread, so I use threading.local() to keep a ...
Eugene Yarmash's user avatar
0 votes
0 answers
50 views

Creation of ThreadPool @PostConstruct public void postConstruct() { threadPool = new ThreadPoolExecutor(corePoolSize != 0 ? corePoolSize : defaultPoolSize, maxPoolSize != 0 ? maxPoolSize : ...
Muddassir Rahman's user avatar
0 votes
1 answer
95 views

Ask please why press Ctrl + C ( KeyboardInterrupt) does not work as expected. (the process is not interrupted, continues to work) from concurrent.futures import ThreadPoolExecutor def sleeper(n): ...
Vitaliy's user avatar
  • 15
0 votes
1 answer
84 views

I am developing a C application in Visual Studio 2022, using winapi. I have some issues regarding logging (for debug purposes) from callbacks when using winapi thread pools. Below is a minimal example ...
broland's user avatar
  • 51
3 votes
1 answer
199 views

In below thread dump, there seems to be two different thread states: JVM thread_state and java.lang.Thread.State. Which one is the actual state of the thread? JVM thread_state is "_thread_blocked&...
vinay sharma's user avatar
4 votes
2 answers
160 views

For a new project at my new job, the tech lead and architect asked me to learn and use boost::asio. Specifically the class thread_pool of the library. Let me put things in context. We are building an ...
anthonyNk's user avatar
0 votes
0 answers
30 views

I have below code: from datetime import datetime, timezone, timedelta from time import sleep from services.ldap import LDAP import aiohttp import os from conf.settings import Settings as settings ...
witty_minds's user avatar
4 votes
1 answer
531 views

I’m working on a .NET Core Web API, and I’ve encountered performance issues and potential deadlocks when calling asynchronous methods. I suspect that I'm using async and await incorrectly. Below is ...
Perturbator's user avatar
0 votes
1 answer
91 views

i am currently running the below python script: # Function to process MMR search def process_mmr_search(row, itemdesc): try: formatted_itemdesc = str(row[itemdesc]) print('...
Ashwin Baldawa's user avatar
0 votes
1 answer
55 views

It's like a thread-pool context. I have a global atomic variable which indicates if working threads should exit: atomic<bool> exit; Such working threads are executed in a loop this way: while (...
Ragdoll Car's user avatar
0 votes
2 answers
131 views

Consider the following codes in Python: from multiprocessing import Pool data = [4] * 10 def update(j): data[j] += j ** 2 def solver(): with Pool(8) as po: po.map(update, range(10)) ...
Tony Shi's user avatar
1 vote
3 answers
3k views

I am using Python's concurrent.futures library with ThreadPoolExecutor and I want to submit inside a function submitted. The following code is a minimal example trying to submit f2 inside submitted ...
Blackteahamburger's user avatar
1 vote
0 answers
63 views

I'm using Java's CompletableFutures for a project, and I got a bit confused on how there are multiple ways to pass an Executor to a CompletableFuture to pass control off to a different thread. ...
Student's user avatar
  • 11
1 vote
2 answers
87 views

I am creating a threadpool by using "https://github.com/alugowski/task-thread-pool/" and calling task using submit function but getting error int Model::sum(int a, int b) { ...
Sijith's user avatar
  • 4,018
-2 votes
1 answer
97 views

In my current Java code, I have the following structure: try { Thread.sleep(1000); } catch (InterruptedException e) { Thread.currentThread().interrupt(); // return; } method1(); method2(); ...
239010391's user avatar
0 votes
1 answer
326 views

I'm looking to schedule tasks to be executed by threads, with the ability to dynamically add or remove tasks from the process. My goal is to pre-create a pool of threads, for example, [th1, th2, th3], ...
R_M_R's user avatar
  • 63
0 votes
1 answer
44 views

I was expecting the below code to spend 1 second in the below test, but it takes 5 seconds. I ran it by ChatGPT and it found no issues either. What could be the issue preventing Spring from running ...
oligofren's user avatar
  • 23.4k
2 votes
1 answer
81 views

In C++ on Windows, given a task started by std::async(std::launch::async, ...), can it be executed first by one thread, and after a possible context switch, stolen and executed by another thread? For ...
sthlm58's user avatar
  • 1,274
0 votes
1 answer
596 views

I'm using Spring Boot and MDC to log additional context with each log entry in my REST API application. I use MDC in the main thread, but the data is not passed to the http threads that are created ...
steros's user avatar
  • 1,934
0 votes
1 answer
89 views

I'm working on a project that involves streaming from a few USB cameras simultaneously using Python and OpenCV. I've been experimenting with multithreading to handle both camera streams concurrently, ...
vukica's user avatar
  • 43
0 votes
1 answer
97 views

I have to design a server with 3 main thread pools in order to read the data, process them and output the results to the client. I code like this but it always notice this kind of bug: java.io....
allmight's user avatar
0 votes
2 answers
148 views

I have a rather simple threadpool implementation for which I need to write a continuation. When a task is enqueued in threadpool it returns an std::future. A caller can then want to enqueue tasks that ...
Gene's user avatar
  • 754
1 vote
1 answer
79 views

I am using the multiprocessing.pool apply_async function to process some video data via a computer vision algorithm, and the current strategy to speed up the process, since the algorithm has no memory,...
Caffeine's user avatar
0 votes
0 answers
93 views

I have created a ExecutorService having 3 threads using which I'm trying to process a list each having 2MM objects. I'm calling below 2 methods after submitting the 3 tasks. executorService.shutdown();...
Darshan Dagly's user avatar
-2 votes
1 answer
96 views

I have an application that consumes four inputs (web cam). For each of these inputs I'm trying to call an API every 200ms. The API doesn't return within 200ms - and in reality, I only need to ensure ...
Mike's user avatar
  • 67
0 votes
1 answer
67 views

I am trying to write a threadpool that divides linearly separable functions (loops) among threads. On my X86 laptop the threadpool scales linearly to the microsecond. On an Arm Tablet (Big Little ...
fabian's user avatar
  • 1,881

1
2 3 4 5
95