365体育足球滚球比分

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
38 views

Why define the Java memory model?

Java's multithreaded code is finally mapped to the operating system thread for execution. Is the operating system thread not thread safe? Why use the Java memory model to ensure thread safety?...
0
votes
0answers
24 views

List<>.get(index)reduces size of List<> in this javafx threading scenario

The function given below uses a List<> to store selected indices and remove them from an ObservableList<>. However, it does not work as expected and I can't understand why. public void ...
0
votes
0answers
20 views

C# System.Timers.Timer Class elapsed event and timer general precautions

Two questions. One: in a winforms application is it a good or bad idea to have a system.timers.timer be enabled and disabled inside of it's elapsed event so that the main UI thread can have access to ...
0
votes
1answer
17 views

Python Threading: What functions run in which thread

So I have a pyhthon application which im attempting to emulate a queue line up system. It import a library and calls to that library, specificaly psycopg2. An example code is as below import ...
1
vote
1answer
18 views

How to use Python Threading with parameter passing between threads

long time lurker, first time poster. Thank you for your time. 1. Summarize the problem I am working with Python 2 and a Raspberry Pi 4 running Raspbian Buster. Trying to limit the speed at which my ...
0
votes
0answers
4 views

How to effect the main thread by the sub thread in python3?

I want to set a simple time counter in a sub thread, and aims at promising make the main thread stopped or throw an exception in the fixed time range. If the main thread has finished already when the ...
0
votes
0answers
10 views

Flask and thread issue

There was a thread running in the background. The same global variables were in the Flask and thread methods. The Flask was in a debugging mode. When a boolean was changed from true to false in the ...
0
votes
1answer
34 views

Waking up multiple threads to work once per condition

I have a situation where one thread needs to occasionally wake up a number of worker threads and each worker thread needs to do it's work (only) once and then go back to sleep to wait for the next ...
-2
votes
1answer
64 views

A noob but confusing question in Java Multithreading Programming

I'm new to Java. I had a problem when learning Java multithreading programming, and here is the code: public class TestMultiThreads { private static int i = 100; private static Runnable r = ()...
0
votes
0answers
15 views

How can I output a message to both clients in a multithreaded TicTacToe game?

public void run() { // send client its mark (X or O), process messages from client try { displayMessage("Player " + mark + " connected\n"); ...
0
votes
0answers
13 views

Animating a CustomUserControl created at runtime

The issue I'm having is that when I begin a storyboard, it changes the value in the object as expected, but there is no visible animation. Nothing happens while the storyboard is running, then when it'...
-2
votes
0answers
16 views

pthread_cond_wait rise “Abort trap: 6”

I'm trying to write a multithread program in C using pthread where a set of threads are waiting for a condition to be true before proceeding with execution. So I've tried to use a condition variable ...
0
votes
0answers
33 views

When to use std::future and std::promise with std::thread

So when I need to return value from the thread without OOP main options are to have a function parameter passed by reference and to use promise-future mechanism. #include <iostream> #include &...
0
votes
2answers
30 views

Are these threads running in parallel

I have the following code: from threading import Thread from threading import currentThread def f(i, name="default"): print("Thread named {} with id={} is working".format(name, i)) for i in ...
-1
votes
2answers
18 views

Threads. Doesn't display “END” in log

I got 2 classes: First class I invoke Constructor in LogScheduler - is Singleton, constructor create new Thread and start it. Main Thread going sleep on 5 sec, then i set boolean variable false to ...

15 30 50 per page
1
2 3 4 5
8201