Category "multithreading"

Multithreading not improving results in python?

I am applying Multi-threading to a python script to improve its performance. I don't understand why there is no improvement in the execution time. This is the c

How to know which specific runnable has died in my threadPoolExecutor?

I am running a fixed amount of threads using newFixedThreadPool() and need to be able to know when one of the runnables has died, and know which specific run

C Producer-Consumer Using PThreads

I am working on a problem where I am implementing a program that mimics the producer-consumer paradigm. The code that I am using works when I only have one prod

Odd-Even sort Java using multithreading

I am new to this group, so I believe it is a possibility to get help here since I could not find any information about my question on Google. I am trying to imp

Post request with threading

Here is my snippet: urls = ["http://goggle.com", "http://linux.com"] headers = {'Content-type': 'application/json', 'Accept': 'text/plain'} data= {"k1": "v1"} f

Locust Python: Kafka Consumer in a separate thread

I'm using Locust for load testing. I want to register a Kafka consumer in separate thread to measure the time of message processing. Here is what I got now: def

Is .GetAwaiter().GetResult(); safe for general use?

I read in a few places that .GetAwaiter().GetResult(); could cause deadlocks and that we should use async/await instead. But I see many code samples where this

Parallelizing different functions at the same time in python

I want to execute f1 and f2 at the same time. but the following code doesn't work! from multiprocessing import Pool def f1(x): return x*x def f2(x): return x

Why did the Django model return an empty queryset in the thread pool?

I used ThreadPoolExecutor in my API. in the test case, I generated a Movie instance and saved it in the database (PostgreSQL). I printed movie count in the test

what happens if thread calls join() on itself

From what i read here Thread join on itself ; When join method is called on itself, it should wait forever I am currently preparing for ocajp 8 certificatio

How to read into a running processus in c?

Hi how to read into a processus and how to use IMAGE_FILE_HEADER to read the pe header in this processus, thanks for replies:) sorry for my english i'm french

static ScheduledThreadPoolExecutor in CompletableFuture.Delayer

In java-9 the new method completeOnTimeout in the CompletableFuture class was introduced: public CompletableFuture<T> completeOnTimeout(T value, long time

Is the `is` operator thread-safe/atomic in C#?

Is the following code thread-safe? public object DemoObject {get;set;} public void DemoMethod() { if (DemoObject is IDemoInterface demo) { dem

I am parsing RoboCopy logs from Millions of files, How can I make my code run Faster?

New to StackOverflow, I'll do my best to post correctly :) Hoping someone can help me to get my code running faster. The code is run against RoboCopy Migration

How to sleep a thread in java for few milliseconds?

I would like to sleep a thread for 1ms. I used to implement the sleep in java code with Thread.sleep(x) being x the amout of milliseconds that I want to sleep.

Creating multiple threads in C

I am just a beginner in Programming using C.For my college project I want to create a multi-threaded server application to which multiple clients can connect an

Why Rust prevents from multiple mutable references?

Like in the topic, why Rust prevents from multiple mutable references? I have read chapter in rust-book, and I understand that when we have multi-threaded code

Why is future.get() always timing out for Volley RequestFuture?

I am trying to make a synchronous Volley networking request. I am using request futures to wait on a response, but the future.get() call always times out (no ma

Ways to make maven build faster?

I have a multi module java project. Maven takes almost around 40 secs to build it. I have tried maven with multi threaded builds too by specifying -T and -C arg

How do I keep my Async method thread safe?

I need to write a method in my Windows Universal App to write to the SD card. How can I ensure two threads do not try to write to the same file at the same tim