返回首页
We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [multithreading]

Multi-threading is the ability of a computer or a program to perform work concurrently or asynchronously by utilizing multiple concurrent streams of execution (generally referred to as threads).

Filter by
Sorted by
Tagged with
0
votes
2answers
28 views

Output of one Task input to other Task C#

In Winforms, I have following: ProcessClientAsync adds an element to a ConcurrentDictionary. How can I ensure that the forloop runs after the Task.Run(). I tried to remove ConfigureAwait but it ...
0
votes
0answers
10 views

Android: Delay UI updates unless a specific action is performed

I have 2 methods(A and B) which updates UI(should run on UI thread). A displays a popup and B will update UI. How can i delay execution of B unless popup is dismissed(or any other alternative to ...
0
votes
0answers
8 views

Allocate the resource of some threads to a global resource such that there is no concurrency(using only mutexes)

The summary of the problem is the following: Given a global resource of size N and M threads with their resource size of Xi (i=1,M) , syncronize the threads such that a thread is allocated,it does its ...
3
votes
0answers
46 views

Is it ok to use atomics to reduce locking in a read dominant multithread program?

Recently, I found myself often in a situation that shared data get read a lot, but written rarely, so I begin to wonder is it possible to speed up the sync a little bit. Take the following as an ...
0
votes
1answer
13 views

How Does LabVIEW Handle Multiprocessing and Multithreading?

INTRO multiprocessing = using multiple CPU cores to complete a task (each core has separate memory, thus requires pipes and data structures for each core to "talk" to each other") multithreading = ...
0
votes
0answers
14 views

Why PHP ZTS is disabled by default?

Why ZTS is disabled by default and we should compile PHP source to achieve Threading ability? Is there any limitation or side effect when we enable ZTS? Is it unstable?
0
votes
0answers
13 views

Mybatis is taking a long time to scan configuration files

I'm using myBatis and Java based configuration rather than the XML based configuration. I wonder if I should switch to XML files. I do the following to get the SqlSession object: private ...
0
votes
1answer
21 views

Controlling UI controls (Lables, panels, buttons) and reading UI elements through a thread

I have seen similar questions. But none of them worked for me so far. I am doing some complex calculations in a separate thread. In order to do so, I need some information from the main UI thread. For ...
-1
votes
0answers
16 views

ForkJoinPool for going Multithread or For going parallel?

I know Multithread/Concurrent and Parallel are conceptually different. Is the fork-Join pool used only to implement parallel or is it there for parallel and multithread both? As there are forking ...
0
votes
1answer
14 views

Cython prange with function reading from numpy array (memoryview) freezes, why?

I have to use the rows of a numpy array sequentially so I am doing that with a loop. I tried adding prange for speed but it ends up freezing. I am most likely doing something wrong, I may be ...
8
votes
1answer
83 views

Is it possible to limit threads count for C++ 17 parallel `for_each`?

I use std::for_each with std::execution::par to perform complex computation on huge input represented as vector of structures. The computation doesn't need any delays related to hardware (network or ...
1
vote
2answers
56 views

Label click event to run on a new thread in C#

I am dynamically generating some labels with the help of data from the database. Then I added some events to these dynamically generated labels. I am trying to run the click events of labels in a new ...
0
votes
1answer
38 views

Java thread not stopping even after calling cancel method?

public class my { public static void main(String[] args) throws InterruptedException { SomeService service = new SomeService(); CompletableFuture<Void> async = CompletableFuture....
-2
votes
1answer
48 views

Threads and stringbuilder

I have this code which should output String length = 10000, but i keep getting different outputs, and i am confused on how is it exactly happening? is that because for example thread 1 will append ...
6
votes
1answer
90 views

Where is the race in this thread sanitzer warning?

The below code produce a warning when running with thread sanitizer on macOS. I can't see where the race is. The control block of shared_ptr and weak_ptr is thread safe, and pushing and popping from ...
0
votes
0answers
18 views

Creating a Pool of Connections as Threads for MongoDB Connection with Python

Things I would like to Achieve: I want to store my mongodb connections as 3-4 threads on Memory by which I want to make a pool of connections. I don't want to create a connection everytime when my ...
0
votes
0answers
16 views

How to create multithreaded HTTP client in C for the following server code [on hold]

I am unable to make my HTTP client as multi-threaded. The code for the multi-threaded HTTP server is below. Kindly share the right way to execute the code below: http://github.com/ozgurhepsag/Multi-...
0
votes
2answers
67 views

Thread-safe task queue await

I want to do a simple thing (assuming that ContinueWith is thread-safe): readonly Task _task = Task.CompletedTask; // thread A: conditionally prolong the task if(condition) _task.ContinueWith(o =...
0
votes
0answers
13 views

Python program stuck on exit when using atexit to terminate threads

I'm playing around with threads, and I want to use atexit to register a cleanup function that will (cleanly) terminate the threads. For example: def shutdown_threads(threads): for t in threads: ...
0
votes
2answers
52 views

What if thread obtained a lock on object

I have gone through an interview and i came accross a question of thread i was bit confused on this. If thread has obtained a lock on object, can other threads invoke non-synchronized method on same ...
0
votes
0answers
31 views

(Xcode 11.2.1) Cannot find Thread Sanitizer runtime support library (iOS)

With Xcode 11.2.1 created a single View project for iOS and enabled the Thread Sanitizer in Scheme. Note: Running the app on Simulator iPhone Xr 13.2.2 Once run the project, getting below error: The ...
0
votes
1answer
46 views

Locking many resources without wait & hold in Java

I ran into the problem of having to lock 2 or more resources, which led to a Deadlock when using ReentrantReadWriteLocks, even after having the same locking order everywhere*. I implemented a method ...
1
vote
1answer
46 views

fork() duplicates process, how about threads?

I am figuring out how threads with fork work and here is the code that I have tried to make some sense of. (Pardon the errors in the code) #include <stdio.h> #include <pthread.h> #include ...
0
votes
0answers
13 views

Whats the best way to speed up plotting in Python on a Raspberry Pi? Currently using Matplotlib to sample data and plot it in a serial method

first time posting on here - Currently I'm using Python on my raspberry pi to sample some data from a thermocouple. Basically, I'm sampling the thermocouple every second and saving the temperature ...
1
vote
1answer
16 views

How could I give a inherited class function to a thread?

import threading class A: def func(self): print('asdf') class B(A): def func(self): print('1234') class C(A): def func(self): print('xyzw') def f(inner_func): ...
0
votes
1answer
58 views

Initial thread data chance?

I'm still somewhat new to threads and was wondering if I have an array of threads that get passed data from a loop. Is there any chance that the initial data passed to that thread could change before ...
0
votes
1answer
19 views

How could I give a lower class function to a thread?

import threading class A: def func(self): print('asdf') class B(A): def func(self): print('1234') class C(A): def func(self): print('xyzw') def f(inner_func): ...
0
votes
2answers
43 views

java multi threading executor never shutdown threads

Could some one take a look this below program ?. It is working fine for small process, but not exiting the program after completing large process. Note: If it is small size query, about 50 records (...
0
votes
0answers
11 views

JPanel thread freezed during jdbc operation on main app [duplicate]

I have a main GUI interface that freezes when the app is doing some database checks with jdbc driver. My idea then was to start a thread that would create a new "loading" jpanel to keep user informed ...
0
votes
0answers
27 views

Solve “deadlock-like” situation with python threading and tkinter

I'm having a "deadlock-like" problem, where a thread needs to wait for the main thread to close before closing, but of course that one won't close until the other one closes. My code is analogous to ...
1
vote
1answer
20 views

Multi-threading using Merge sort

I am newly starting using Linux in Ubuntu and am trying to code a multi-threading merge sort but some kind of errors are showing on Windows terminal. #include <stdio.h> #include <stdlib.h&...
0
votes
0answers
17 views

Suspicion of thread leak with Phusion Passenger

I am facing a problem in production. Many ThreadErrors occur with active_storage/representations#show and resque/work. My error is ThreadError · can't create Thread: Resource temporarily unavailable ...
0
votes
1answer
30 views

Tkinter indeterminate progress bar getting stuck with threading

I am facing issue with the progress bar. In the go_ahead function() I am actually calling another python program which processes two files for fuzzy matching. For this, I have just replaced it with a ...
0
votes
0answers
43 views

My threading function doesn't stop the thread I want

I'm trying to make a stopwatch class, which has an seperate thread that counts down. The issue here is that when I use the cancel function or try setting up the stopwatch again after a timeout, my ...
0
votes
0answers
15 views

How do you perform Multithreaded Frame Extraction in Python with OpenCV?

Hi Stackoverflow Users, I'm currently trying to perform a multithreaded frame extraction using OpenCV. I've made such multithreaded operations before on other tasks, but for some reason it doesnt ...
0
votes
1answer
38 views

How to sum the similar threads inside ExecutorService in java?

I'm trying to sum the similar threads inside the ExecutorService. I think I should use join() method, but I wasn't able to do it correctly. My Code: import java.awt.BorderLayout; import java.awt....
0
votes
0answers
27 views

Does make sense (where) apply concurrency to Bread / Gravity Sort?

I'm testing CPU bound wih and without threads, but when I get to the Bread / Gravity Sort algorithm, that I implemented because its exponentiality, I don't know if makes sense to apply concurency / ...
3
votes
1answer
45 views

Visibility in Kotlin coroutines

I decided to dive in into Kotlin coroutines. I have some questions regarding visibility. I understand that in absence of a ContinuationInterceptor, it is possible different sections of the same ...
0
votes
0answers
19 views

How to determine true/false sharing misses in cache coherence?

I have a question regarding True/False sharing miss in Cache coherence. Xl and X2 are in the block B. The block B is initially in the private caches of processors Pl and P2. The system uses MSI ...
0
votes
1answer
33 views

Implementing multithreading on a list of objects

def return_total(): dE_total = 0 for num in range(len(self.layer)): dE_total += self.layer[num].backprop(delta[num]) return dE_total I have the above method inside a class. I need ...
0
votes
1answer
27 views

Scheduler works incorrect in unit testing

I need to collect data from a public API. I want to collect it daily or twice a day. public class AlphavantageStockRequestDispatcher { public static void startAlphavantageStockScraper(int ...
-3
votes
0answers
37 views

Why is my reader writer program giving seg fault( uses semaphore and threads) [on hold]

Why does the following program (reader writer) with semaphore and thread giving seg fault? #include<stdlib.h> #include<semaphore.h> #include<stdio.h> #include<pthread.h> #...
0
votes
1answer
29 views

How can i get multi thread parallel calculator (factorial sum)

I will input some number to calculates sum of Factorial series, like if i put 5, output will be 1!+2!+3!+4!+5!, but calculating processing could be heavy so i want to use multiple treads that ...
1
vote
1answer
39 views

Django (REST Framework) Returns Empty List Every Other Call

I have a simple function that generates a random sample list of items from the outer dictionary. def get_random_product_feed_for(mid, n=DEFAULT_AMOUNT_ITEMS_RETURNED): assert mid is not None, '...
-1
votes
1answer
30 views

In a multithreaded application, how to prevent a thread to modify data which is being already modified by another thread

Suppose, I have an application deployed on 3 nodes and from each node, one thread is trying to fetch and update the same data record at the same time. Data can only be fetched and updated from the ...
-2
votes
0answers
21 views

How to build a queue which get filled by background threads using processes or daemons?

I'm looking for a queue which get filled by a background processes. To give more context. When I'm creating a Neural-net I've to feed my network with batches of data. But creating 1 batch of data ...
0
votes
0answers
20 views

Android Java Read With BufferedReader Parallel And AsyncTask MultiThreading

My Dears, I'm flighting to can read multiple CSV Files from Google Cloud Firebase Store. I'm doing that: new GetCompaniesCsvFile().execute("companies.csv"); and new GetLinesCsvFile().execute("...
0
votes
1answer
28 views

Does p-queue use multiple threads?

There is a nodejs module that lets you limit the number of concurrent promises: http://github.com/sindresorhus/p-queue Does this make use of multiple threads? Example from the official page: ...
1
vote
1answer
25 views

Java Nested Monitors (moving past apparent deadlock)

I'm synchronizing and blocking on the same object. Each thread calls the testQueue() method in the PuppetShow class which instantiates a distinct object for each thread to block on. My problem is ...
1
vote
0answers
21 views

Implementing ThreadProc function in MFC [duplicate]

I had managed to implement a thread in c++ console that worked using ThreadProc function but when I wanted to make a functional thread into classes I didn't succeeded, this error has appeared: ...

返回首页
杏彩计划 杏彩官网 杏彩APP 杏彩走势图 杏彩下载 杏彩官方 杏彩网站 杏彩怎么玩 杏彩官方 杏彩靠谱吗 杏彩代理 杏彩骗局 杏彩投注 杏彩倍率 杏彩开奖 杏彩漏洞