4,740 questions
2
votes
1
answer
54
views
Cannot start a ThreadPoolExecutor inside a threading.Thread function
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 ... ...
1
vote
0
answers
111
views
Can a threadpool be locked by a large number of threaded functions that also thread functions? [closed]
Since a thread pool generally uses a queue for jobs that are run in the n number of threads that a thread pool uses, is it possible that function that is something like
class ThreadPool
{
// ...
...
0
votes
1
answer
64
views
subprocess.run() eventually reaches python's global thread limit
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&...
-1
votes
1
answer
113
views
Get the list of cancelled tasks which were in progress when the executor was shut down
LISTING 7.21 ExecutorService that keeps track of cancelled tasks after shutdown.
public class TrackingExecutor extends AbstractExecutorService {
private final ExecutorService exec;
private ...
1
vote
1
answer
76
views
Thread pool implementation do not end properly when joined
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 ...
0
votes
0
answers
93
views
Multithreading issue with GIL for CPU-bound task in Python
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):
...
0
votes
1
answer
79
views
How best to handle an exception in a third party method called by ThreadPool.QueueUserWorkItem?
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 ...
3
votes
0
answers
135
views
Why are thread pools so significantly slower than parallelStream for this scenario?
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 ...
0
votes
1
answer
98
views
Actual practical advantage of SQLAlchemy scoped_session vs classic session in worker
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 ...
3
votes
2
answers
126
views
Run background process in high priority TaskScheduler
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 ...
0
votes
0
answers
77
views
How to Efficiently Process a Concurrent Queue Using a Thread Pool in Java?
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 ...
1
vote
0
answers
96
views
Managing ThreadPool and Connection Pool sizes with CompletableFuture for concurrent third-party API calls
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 ...
1
vote
1
answer
295
views
How to implement thread pool without ExecutorService
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 ...
3
votes
1
answer
184
views
Delphi TThreadPool destructor causes a deadlock from DLL built with the runtime packages
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, ...
1
vote
1
answer
214
views
Virtual Thead Names on Intellij Debugger
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 ...