Category "multithreading"

Single thread and asynchronous confusion

I've read various articles and similar questions, and I know that the two concepts are different, but I don't seem to know the correct answer. I understood that

Appending to a TextArea from multiple threads on JavaFX [duplicate]

I am currently creating a program that utilizes multithreading. In each thread, it appends to a TextArea. I've come upon an error that I belie

What is the use of Condition along with Lock in Java

I am trying to understand what is the use of doing condition.await() if I am already doing lock.lock() If I understood locks correctly, once I do lock.lock() it

How to use onnxruntime parallel with flask?

Created a server that want to run a session of onnxruntime parallel. First question, will be used multi-threads or multi-processings? Try to use multi-threads,

Threadpool executor Need Suggestion on call function or some steps before call executor.submit

I have a parallel threadpool execution like below with concurrent.futures.ThreadPoolExecutor(max_workers=workers) as executor: # Start the load operations

How can I reproduce Serilog's LogContext behavior?

this is a question of functioning issue, because I didn't understand correctly how you use information sharing. I'm wanting to do something similar to LogContex

Thread.currentThread() performance

I have Runnable queue that invokes one by one in specified thread. val queue = LinkedBlockingQueue<() -> Unit>() val queueThread = thread { while(tr

Make codes run at once for all users

Is it possible to listen to each users contract events from the database at once I've tried but it only works for one user.. Helps will be appreciated Web3 pyth

Can double checked locking be abstracted/simplified?

My company uses double checked locking all over the place in our code. Because it is so pervasive - and so verbose - I was wondering if there is a good way to a

Blocking main thread with SemaphoreSlim until background event arrives

Yes, I know, there are tons of threads on this topic. I read a lot of them and used them often (more or less) successfully. Now I got an old DLL (programmed in

Simple Java Animation using JFrame and JPanel

Ok, so the program's purpose is to just draw and oval and move it across the screen. The code compiles on Eclipse without an error, but when run, no oval is dra

How can I await at least specified amount of time with Awaitility?

I my test class I really need to sleep for some amount of time. It's an integration test involving periodic remote call. for (int i = 0; i < 16; i++) { /

Flutter Plugin: crash_dump.cpp: failed to attach to thread 185: Permission denied

I am developing a Flutter Plugin and a simple piano keyboard layout which calls the Flutter plugin when onKeyPressed and onKeyUp the piano keys. The piano app c

futures.wait() or futures.as_completed() blocked while all futures are Completed or Cancelled

I have a bug with futures.as_completed() or futures.wait() that will be blocked indefinitely when all Futures are completed or cancelled. Here the steps to repr

Joining multiple thread in Python is not blocking the main

Hello I'm trying to block the main until all the threads are done. Apparently even by executing the .join() method, the main sometime doesn't wait all the threa

Should you always put join() after launching a thread?

I wonder if there is any advantage putting join() not immediately after launching a thread? std::thread t(func); // some code ... t.join(); does it give you

Python raises error when I use graphics.py commands inside a function when using multithreading

I'm trying to create a little game where when you type in 'inventory' it opens a little window to display your items. However it doesn't work and give me an err

What thread runs the code after the `await` keyword?

Let me just post a simple example: private void MyMethod() { Task task = MyAsyncMethod(); task.Wait(); } private async Task My

Why Concurrent Collector in Java besides using ConcurrentMap does not use some Concurrent List Implementation?

Consider the signature of the concurrentGroupBy: static <T,K> Collector<T,?,ConcurrentMap<K,List<T>>> groupingByConcurrent(Function<

asio::thread created in object with global scope causes strange behavior, but not if it is created in main

I have been battling a problem for a day or so and "solved" it but I wonder if anyone knows why it must be so, or whether I have just hacked my way around a dee