Category "multithreading"

Executor pauses and doesn't process pending queues

I have a long-running task of creating a bitmap saving it and recreating more bitmaps which I was doing on a single background thread ExecutorService executor =

Develop a multi-threaded application. Don't use synchronized word [duplicate]

Free checkout. The fast food restaurant has several cash desks. Customers stand in line at a particular cash desk, but can move to another que

How to successfully implement Multiprocessing Lock?

I have been following the example synchronization-between-processes from the multiprocessing document. The script is as follows: from multiprocessing import Pro

Volatile reference to mutable object - will updates to the object's fields be visible to all threads

... without additional synchronization ? The Tree class below is meant to be accessed by multiple threads (it is a singleton but not implemented via an enum) c

Threading and Tkinter - How to use the threading module with my simple example?

I don't understand how to use the threading module properly. In this example I have two tkinter widgets, a button and a progress bar. The progress bar (configur

Get array of elements from list that sum to value, using Parallel.ForEach (multiple threads)

I'm using the below code to get an array of elements from list that sum to value. However, it only using 1 CPU. My PC has 64 cores so I want to use 100% CPU to

how to restart subprocess if it crashes?

I'm trying to restart a subprocess if it crashes, but somewhy this loop just doesn't work. I've been wondering if that's even possible? def dont_stop(conv):

How to do two tasks at the same time in asyncio or multithreading?

I'm trying to achieve a task that requires real-time interaction, for example: A message (response) is received - it needs to be acted on at the same time. I tr

multiprocessing vs multithreading vs asyncio in Python 3

I found that in Python 3.4 there are few different libraries for multiprocessing/threading: multiprocessing vs threading vs asyncio. But I don't know which one

The publishing code below is stalling on time.sleep() how can i change this behaviour + what would be a good way to implement a thread safe cach

For refreshing skills for a new job i have been trying to implement a very simple price publisher + client + mtm_cache. In the code below in publishing.py the c

Parallel traveling salesman problem solver finishes prematurely

Good time of the day. I'm doing an assignment which involves writing a program that solves Traveling Salesman Problem in parallel using brute-force method. I ma

TIdHTTP::OnAuthorization in multithreaded application

I'm writing a DLL in C++Builder XE6 to communicate with a REST server. The DLL creates a TThread-derived thread to do GET requests in the background, using TIdH

Measuring OpenMP Fork/Join latency

Since MPI-3 comes with functionality for shared memory parallelism, and it seems to be perfectly matched for my application, I'm critically considering rewritin

Split work between writing output from .exe and reading the output

I have a simple .exe downloaded from the apple app store. It gives real-time updates on crypto prices and their percentage change. I am extracting percentage ch

Comparing latency of mutex vs. spinlock wake time

I am curious about the latency of a mutex vs. spinlock, measured as the time between when one thread unlocks it and another waiting thread can access it. I wrot

Restoring Interruption flag status in Java

Good Day! I have been going through the Java Docs & some online resources on properly handling the InterruptedException due to bug reported by SonarQube. Bu

java.lang.IllegalStateException Caused by: android.database.sqlite.SQLiteCantOpenDatabaseException

I m getting the following error in the google play console, and no idea how to solve it. I don't use SQLite in my app. The error started appearing after targeti

Load data from reading files during startup and then process new files and clear old state from the map

I am working on a project where during startup I need to read certain files and store it in memory in a map and then periodically look for new files if there ar

Java concurrent deadlock

Run the Main.main() method seems like a deadlock has occurred. I found out it can be fixed if replace notify() with notifyAll(). But why? Shouldn't the worst ca

Signal and Wait in C#

In the below application there are two parties that are calling ChannelReservationCache to fetch or add information. I want to use the "signal and wait" thing i