Category "multithreading"

When to use std::launch::deferred?

Lines from Anthony William book: std::launch::deferred indicates that the function call is to be deferred until either wait() or get() is called on the fu

how to see which process owns a python thread

My understanding from multi-threading has been that one process (cpu core) can have multiple threads running with it. So far in python when I want to check whi

How do I refactor my code to call AppDelegate on the main thread?

I recently started migrating my project from Swift3/Xcode8 to Swift4/Xcode9. My app crashes at runtime because the main thread sanitizer allows access to UIAppl

C program to print a sentence using threads & semaphores with infinite loop

i am currently trying to make a programm which will print the sentece "What a wonderful world" using three threads. The first thread should print "What A" , the

X-Ray and async multithreading: segment cannot be found

I need to run multiple async methods from the main thread, which should be able to finish even after the main thread has returned a response. I've added a metho

Restarting a thread in Python

I'm trying to make threaded flight software for a project in Python 3.4, in which I need threads to restart themselves in case an I/O error occurs during a sens

Android method performance suddnely slow after upgrade from Marshmallow to Nougat

I have been developing a game, using a Samsung Galaxy S6 running Marshmallow as one of my development devices. After the phone upgraded itself to Nougat, a met

Android method performance suddnely slow after upgrade from Marshmallow to Nougat

I have been developing a game, using a Samsung Galaxy S6 running Marshmallow as one of my development devices. After the phone upgraded itself to Nougat, a met

How to start tasks after cancelling

I have a Windows form with three buttons. One button adds entries to a BlockingCollection. One starts processing the list and one stops processing the list. I

How to close a thread when multithreading? [duplicate]

To simplify the situation I'm having: I'm trying to terminate a thread while it is still running in Python 2.7, and I'm not sure how to do it.

Guid.NewGuid() is returning duplicate values when used in a Parallel.For loop

I have an application that is hitting an API. As such, it does a query for all ID's in the object, and then has to query each item one at a time per ID. I'm d

Why can an Object member variable not be both final and volatile in Java?

If in a class I have a ConcurrentHashMap instance that will be modified and read by multiple threads I might define like this: public class My Class { pri

How to check if a std::thread is still running?

How can I check if a std::thread is still running (in a platform independent way)? It lacks a timed_join() method and joinable() is not meant for that. I thoug

Does async programming mean multi-threading?

lets talk about JavaScript code which has setInterval methods every 2 sec. I also have a onblur animation event for some control. In a case where onblur occurs

Jmeter - All threads other than current thread wait

I am new to Jmeter and I have been struggling with my test plan. Test plan steps: Enters the site Creates multiple wish lists (like the wish list on amazon) I

Jmeter - All threads other than current thread wait

I am new to Jmeter and I have been struggling with my test plan. Test plan steps: Enters the site Creates multiple wish lists (like the wish list on amazon) I

Sleeping barber using semaphore

I am having a problem in the synchronisation of threads. I m trying to implement sleeping barber problem in a different approach. When i run the code the thread

Monitor.TryEnter doesn't work

Part of my code-behind: object _sync = new object(); private async void OnKeyDown(object sender, KeyEventArgs e) { if (!Monitor.TryEnter(_sync)) return;

Is there any method to abort cin or scanf

I have a multithreaded program in which on thread waits for input through a terminal and the other will get data from the socket. Is there any way to abort firs

Running two threads at the same time

I want to know if a program can run two threads at the same time (that is basically what it is used for correct?). But if I were to do a system call in one func