Most voted "thread" questions
Thread (Thread) is a sequence of programmed instructions that can be managed independently by the OS process scheduler.
Learn more…388 questions
Sort by count of
-
1
votes0
answers138
viewsError running Timertask Javafx
I am trying to perform a task every 1 minute. The task is executed but when it arrives at the right minute to perform the action of this exception: java.lang.Illegalstateexception: Not on FX…
-
1
votes0
answers725
viewsTimertask calling method twice
I have a TimerTask which calls a method every 1 minute, but the method is called twice. This method checks some factors and sends an email, as the method is called twice the email is sent twice.…
-
1
votes0
answers60
viewsTheoretical Question - Blocked Thread Closes
What can happen in terms of failures when a thread which is blocked, made I/O or is in a mutex for example, is closed? I can only find practical questions of how to close one thread blocked.…
-
1
votes1
answer136
views -
1
votes2
answers146
viewsUse spring-boot and @Component with @scheduled and it hangs every 12 hours
I have a project done with Jhipster. He uses spring-boot. I use this application as an order platform where I consume several webservices of an ERP and also sound cronizo the data with android…
-
1
votes1
answer248
viewsUpdate a textview for a few seconds
I wanted to implement a transition between two Activitys, where the user, via a Progress Bar (I already implemented) and a textview where every 2 seconds, a new phrase appears to me, for example:…
-
1
votes1
answer76
viewsIs it possible to decrease the startup time of my application?
I’ve seen a lot here and at Stackoverflow in English about Swing and Runnable, I still couldn’t solve my problem. I am developing a work for the college (interdisciplinary work involving Distributed…
-
1
votes0
answers43
viewsoverloading the android thread
I’m making an old game for Android, I did following the book I have. The example teaches to create the game logic for two players to play on the same phone, worked correctly, but the example only…
-
1
votes3
answers131
viewsBucket Sort + Thread
I’m having the following error in this code: #define TAM 10000 /*Tamanho do vetor*/ #define NUM 10000 /*base para gerador de numeros aleatorios*/ using std::cout; using std::cin; using std::endl;…
-
1
votes3
answers2915
viewsHow to access a private attribute of a class in another class?
I created a chat in Java. In the class Servidor, the user passes as input the port on which the server will run. In order for the chat to work correctly, I need to access this class variable…
-
1
votes1
answer54
viewsThread independent from the result
I have a query where returns a list of results; Example: 192.168.1.2 192.168.1.3 192.168.1.4 192.168.1.5 I would like from that list to create a thread for each one independent. For each to do their…
-
1
votes1
answer226
viewsHow to Communicate Between Threads and Pyside Qt?
The graphical user interface window created in Pyside is normally executed following the normal program flow. The actual python script of the program runs in a Thread in parallel. But this thread…
-
1
votes0
answers472
viewsI can’t update jFrame from a Java thread
I have a code that reads the Serial Port through a thread, but when I try to update a label I can’t. I implemented a Serialread Runnable class, and in this class I run a loop to read the serial…
-
1
votes1
answer147
viewsHow to call class method within the thread?
How do I call a class method inside a thread? I have a very simple thread and a class method. How do I call it inside the thread. As it is in the code below the compiler gives error #include…
-
1
votes1
answer150
viewsQuestion about updating Jlabel in Jframe
Why can’t I update my labelHora in the Frame? Using a print after the line labelHora.setText(x); I realized that the content of lip changes, but on the screen continues the pattern, which in the…
-
1
votes2
answers186
viewsHow does Java sync work?
What’s the advantage of having two threads, which run at the same time but which one waits for the other to be completed to be executed? When using the SYNCHRONIZED keyword in a JAVA application…
-
1
votes0
answers48
viewsWhat is the relationship and differences between Process and Thread?
I’m reading regarding the class Process and in the documentation it says that it follows the implementation of Threads, however, I have a question regarding the process class and threads. Doubts How…
-
1
votes0
answers147
viewsHow to use Thread in my project with Tkinter and Selenium
I’m making a bot to get the free books that Amazon made available, so I created a graphical interface, but after discovering that Tkinter does not work the way I wanted, it also stops working when…
-
1
votes1
answer475
viewsReplicate message to all chat customers
I need to replicate a client’s message to everyone who’s connected except the client you sent. Below is the classes I have so far. How could I replicate these messages? public class Servidor {…
-
1
votes1
answer2403
viewsThread - How to use it without freezing screen?
I have a system that goes through some html elements, collecting some links. I would like to wait for a while, but whenever I use Thread.Sleep it freezes my program for the set time. I have used…
-
1
votes1
answer405
viewsThread occupying a lot of memory
Come on . I’m loading Buttons into a panel through the Backgroundworker. That is, within this Background I execute a query in the bank through the EF and fill the panel with the Buttons that contain…
-
1
votes1
answer213
viewsDifficulty Creating Threads
I’m trying to create a Thread. But I’m a beginner in the subject. Someone can point out where my code is wrong. It’s not working Procedure TFormPrincipal.ButtonCompartilharProxClick(Sender:…
-
1
votes1
answer465
viewsCompetition with thread and database inserting duplicates
I have the following problem with competition using Thread. The code below should take the last number of a column of a table and add +1 to save again in the database, the problem is that this…
-
1
votes0
answers763
viewsUsing Tidhttp and Tidconnectionintercept created in Runtime
I have a method that makes a connection to a Restful server and for this uses the components Tidhttp, Tidconnectionintercept and others created in Runtime, so far so good, the problem is that I need…
-
1
votes1
answer46
viewsSecond response of the Web Service still has the value of the first
The first thing I do in my application is send a message to the server, only to test if the connection is active and working. When receiving "ok" from the server I continue the application. On the…
-
1
votes2
answers670
viewsBuilding a python Crawler web. I need help adding threads
I am trying to develop a Rawler web for studies. It is very simple and I would like to improve it. How to use threads to accelerate/improve the process? The program could make multiple links in…
-
1
votes1
answer1489
viewsStart Thread with Input Parameters for Void Method
I try to initialize a Thread that has the function of processing a certain information by a method, so that the main execution line of the program continues running. But I need to pass two values…
-
1
votes1
answer82
viewsQT - View Webcam on a Qlabel using another Thread?
Hello, I’m doing a C++ project using QT GUI. In the project in question I need to display images of a camera in the window, but in doing so, the performance of the window is very compromised, all…
-
1
votes1
answer506
viewsHow to "generate" multiple TCP clients using Threads in the same script?
I wrote the code of a simple TCP client: from socket import * # Configurações de conexão do servidor # O nome do servidor pode ser o endereço de # IP ou o domínio (ola.python.net) serverHost =…
-
1
votes1
answer72
viewsHow does Backgroundworker e.error work?
I am creating an application that makes multiple connections simultaneously. For each connection I create one TextBox and a BackgroundWorker. When executing the DoWork of BackgroundWorker I use…
-
1
votes1
answer100
viewsNested for conversion to threads
I got the following for nested throughout the length of an image bitmap in C#. I would like to rotate the second one with threads to be executed in parallel. Bitmap alterado = new…
-
1
votes2
answers633
viewsToast is not displayed
I’m having a problem Toast doesn’t show up when I make a request on for my web service, the whole method stays inside my thread, I did a test putting a message out of the thread then it shows up,…
-
1
votes1
answer421
viewsReturn to main() after using start()
After executing the command gerenciador.start(), my program does not return to the function main, and does not print the message is over. It simply executes the command I have spoken. Does anyone…
-
1
votes1
answer270
viewsThreaded barriers - Output snippet code
I have the following code snippet. Can anyone explain to me the following question? In the main when I create the two threads, I go to the Boat and I can tell he’s sleeping for a second. Why main…
-
1
votes1
answer753
viewsHow to create a pause method and one that resumes a Thread?
The following script shows the x variable every 3 seconds, while the xx class, which is running on a thread, increases the x value every second. I would like when the value of x reaches 13, the…
-
1
votes1
answer388
viewsUse of Thread in c++
I created a code to check the prime numbers, but I’m trying to use the core of my processor to calculate them. #include <iostream> #include <Windows.h> #include <vector> #include…
-
1
votes0
answers87
viewsMulti-threaded chat
Guys I’m developing a chat bot, the question with the answer that the bot gives is all right, my problem is when more than one person comes in contact with the chat, he is treating as if both are…
-
1
votes0
answers44
viewsInvokemainthread Xamarin
I’m having a problem invoking a Uithread on PCL. I made a method like this: private void PopularConteudo() { Task<List<Departamento>> taskDep = new…
-
1
votes0
answers259
viewsThread initialization using runnable interface
I’m having a problem creating some threads: The mistake is: "The method Actualizprodutorunnable(Affiliate, List, Arraylist) is Undefined for the type Home" in Main Class: for (Filial filial :…
-
1
votes1
answer166
viewsBound Service using Intentservice
I am creating an Intentservice with Binder, so I can communicate with that service from an Activity public class MyService extends IntentService { private ChatManager chatManager; private final…
-
1
votes1
answer83
viewsApplication continues to be executed even after closure
I’m having a problem with my application. The same continues in the list of processes even after its completion, besides it, also appears in the list the application Clickonce. Setting My…
-
1
votes1
answer1345
viewsTraffic Light Problems (Producer/Consumer)
Hello! I am trying to solve the Producer/Consumer Problem using semaphores, but I am struggling. I’m using one thread for producer and one for consumer, but I think the program is initiating the…
-
1
votes1
answer318
viewsHow to return integer value in pthread?
How to return an integer value and be able to show with printf using pthread ? Follow an example of the problem : #include <stdio.h> #include <unistd.h> #include <stdlib.h>…
-
1
votes1
answer87
viewsCatch Startaddress with the Thread Module name of an external program
I’m trying to differentiate the threads of a particular program. with "Processexplorer" software I can easily get through Start Address, since the method name appears: I tried to catch Startaddress…
-
1
votes0
answers145
viewsConcurrent programming
Hello, I’m having trouble finding the error in the code below. It is a problem where ideally, having 5 vacancies available, any one of the types of threads (server or trainee) can be sit freely, but…
-
1
votes0
answers1737
viewsWhat is the correct way to interrupt a thread in Delphi
I am creating a thread with the basic information and structure as indicated below. Apparently everything is working well, but I noticed that when executing the Terminate, thread does not pass…
-
1
votes1
answer108
viewsHow to implement a Thread to allow cancellation of Stringgrid fill in Delphi?
I load spreadsheets in a Stringgrid and then insert them in the bank, wanted a thread to allow to cancel this import, that is to cancel the completion of stringGrid, the button is "Inclicavel" as…
-
1
votes0
answers200
viewsThreads and Interrupt();
I wonder how I can pause my Thread efficiently and correctly with the interrupt method(); I’m with a part of my class that I started, but I’d like to pause it. My project consists of a websocket,…
-
1
votes1
answer563
viewsRun simultaneous java threads with parameters, run method
I have a service today that I need to calculate its running time with multiple accesses, so I’m trying to run simultaneous threads and log that time, the problem is that for the run method of the…
-
1
votes1
answer169
viewsDifferent behaviors between Linux and Windows using threads(pthreads)
I’m using the Linux pthreads library to try out the functionality of threads, the code below prints 5 messages on the screen for each thread, each thread waits its turn to display the message…