Skip to main content

Questions tagged [threadpool]

A thread pool is a method to reuse existing threads, rather than always creating new ones. They allow for pooling resources in given limits and automatically assigning tasks to open workers. Use this tag when you have questions about implementing a thread pool, or using an existing thread pool implementation.

threadpool
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 ...
Higor Freitas's user avatar
0 votes
0 answers
31 views

How to use multithreading to traverse a quadtree built from a point cloud model

The simplest description of this problem is how to traverse a quadtree using multiple threads. The following figure is the quadtree model of my problem: My algorithm does not need to traverse all ...
zymaster's user avatar
3 votes
1 answer
58 views

ThreadPool.RegisterWaitForSingleObject leaks RegisteredWaitHandle objects (and memory) over time

I build an extension method for WaitHandles (especially ManualResetEventSlim) to make them usable in async code. Usage looks like this: public class WaitHandleExampleClass : IDisposable { private ...
behindwhere's user avatar
-1 votes
0 answers
41 views

How can I find if the current fiber is running in the primary or blocking thread pool [duplicate]

My app runs thousands of small tasks in parallel using foreachPar(){}.withParallelism(85). The app runs on a machine with 100 CPUs. Some tasks finish in a few milliseconds, while the others finish in ...
Art's user avatar
  • 3,155
-2 votes
0 answers
21 views

When building a custom DiscardOldestPolicy, doesn't it make sense to insert new task at back of queue instead of head? [closed]

I am building a threading policy where I start off with 1 thread, which increases to 3 max if needed, and shuts down if ay thread if unused for 10 seconds. For the queue, I was thinking about using ...
Khalid's user avatar
  • 1
-1 votes
1 answer
89 views

How is it possible to start more threads than my machine's logical cores? [closed]

I have created below program to understand the threads. Below program creates 1000 threads and created the loop to run for very very long. for(int i = 0; i < 1000; i++) { var j = i; Console....
Sivarajan Sivanesan's user avatar
0 votes
1 answer
28 views

Main loop waits on thread pool despite using map_async

I have a multiprocessing thread pool with a loop running on the main thread. The main loop must run without being blocked: It issues a task to the thread pool on startup and whenever all results have ...
MirceaKitsune's user avatar
1 vote
1 answer
29 views

How to kill all the threads in ThreadPools

How can I kill all the threads in ThreadPools(threadpoolexecutor) when one thread finishes?
rao's user avatar
  • 353
-1 votes
0 answers
35 views

Multiple ScheduledThreadPoolExecutors using parallelStream deadlock one another

we use Java17 and Springboot 2.7.2. So, debugging into a customer I saw that there are two thread pool worker threads (only two exist at this moment, seen by debugger) that both wait in the ...
IceFire's user avatar
  • 4,096
-1 votes
0 answers
27 views

Single vs. Multiple ThreadPoolTaskExecutor in Spring: Pros and Cons, and Use Cases

When configuring ThreadPoolTaskExecutor for Spring application, we can : Using a single ThreadPoolTaskExecutor with a large core pool size. Using multiple ThreadPoolTaskExecutor instances with ...
Tom's user avatar
  • 85
0 votes
0 answers
21 views

pool.map() method of Python ThreadPoolExecutor can accept more iterables?

I would like to know if method pool.map of class ThreadPoolExecutor can accept more than one iterable. from concurrent.futures import ThreadPoolExecutor def increment(n1,n2): print(n1+1) ...
Frederick_'s user avatar
0 votes
0 answers
16 views

Hystric Thread Pool is creating new database connection for each DB requests

I am using springboot application talking to mysql database. I have also enabled hystrix threadpool in it. 1 API requests is making 10 db requests. Now since i have hystrix threadpool enabled, 1 http ...
pavan singh's user avatar
1 vote
0 answers
63 views

How to synchronize threads in PyQt?

I want to accomplish the following in pyQt: Run task 1 and task 2, in separate threads (not in the main thread), as parallel as possible. Only when both threads are finished, trigger running task 1 ...
Huapua's user avatar
  • 13
0 votes
0 answers
53 views

Unable to queue a function to a ThreadPool

As the title says, I have been unable to appropriately call the thread queuing function doJob() to assign my output function to a thread in class ThreadPool (code below). The issue seems to be with ...
LazyBear's user avatar
  • 343
-1 votes
1 answer
33 views

If I want to allocate a separate thread pool for a specific operation, how should I determine the thread pool size?

I have a Spring boot application running in production. I am implementing an async feature that exports a certain metric that can run on its separate thread pool without blocking the main application ...
Sankalp's user avatar
  • 1,269

15 30 50 per page
1
2 3 4 5
315