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
-
2
votes1
answer588
viewsDelphi - Make a Thread that plays a song in a loop
I managed to make a Thread that plays the song, but only once. If I put a loop on it I have several errors, like the 1400. It seems that the thread does not close when you close Form1, because the…
-
2
votes0
answers202
viewsDoes an Android service lock the application even running in the background?
Does an Android service lock the application even running in the background? Or is there something wrong with my application? I have a database where the last table has 3,000 lines. With this I…
-
2
votes1
answer366
viewsJava: Problems with Wait() and notify()
Good evening, I’m doing a java project where I make connections between the client and a server. This client sends Messages to another recipient. It is up to the Server to handle this message by…
-
2
votes1
answer160
viewsAccess List<List<string>> in a Thread
I am using Winforms I can’t access a list inside a Thread. That list I’ve populated it through another method. If you leave the cursor on top I can see the items, but when I will recover through…
-
2
votes1
answer504
viewsView Splashscreen with progress while Jframe is loaded
I have an app made on swing, and I’m trying to add a SplashScreen in it. I managed to make the class SplashScreen work normally, but I’m not able to synchronize the loading of Jframe in invokeLater…
-
2
votes1
answer380
viewsRoutine included in Threadpool to run in "background" does not let the application continue running
I have the following code snippet in a method from my ASP.NET MVC application that deals with deleting directories and their files. // efetuo processos de remoção de arquivos do banco de dados await…
-
2
votes0
answers552
viewsSynchronization of threads in python
I am making a program that should simulate the synchronization of files between two threads, however, I do not know much the python language. I have already created the threads, lock methods and…
-
2
votes1
answer817
viewsJava threaded timer
Good night, you guys! I am developing a multithread client/server system. Multiple clients connect and when they send the string "Ocupada" 3 times, the code leaves the while, starts the time count…
-
2
votes1
answer879
viewsHttpcontext.Current.Session is null in thread
Hi, I have a problem with my code. I’m doing a function that lasts about 3/4 hours long, and then I decided to do this function in a thread so that it doesn’t block the overall functioning of the…
-
2
votes1
answer195
viewsStart a thread again
I have an event on the start button, every time I press 3 threads are generated that start the count from 30 to 0, to which reach 1º to 0 wins. But however I press the start button a few times and…
-
2
votes2
answers304
viewsHow to Manipulate Objects in a Thread?
I have the following code: MinhaClasse[] obj = new MinhaClasse[QtdUsuario]; Thread th; For(int i = 0; i < QtdUsuario; i++) { obj[i] = new MinhaClasse(); th = new Thread(new…
-
2
votes1
answer1450
viewsHow to pass parameters to run on a Delphi thread
I’m having trouble assigning a variable value inside a Thread Run. need to assign a value to the variable Name through the Fname that is inside the execute of a thread. follows the example I’m…
-
2
votes1
answer278
viewsHow to avoid blocking requests?
I’m doing a project in ASP.NET MVC + IIS and realized that when making a request to a page with long reading in the Database (using Entity Framework), if I open another window and try to access any…
-
2
votes1
answer2460
viewsExample of Thread Pool in Delphi
How do I make a pool of Thread, I need to execute a process that contains several records, but I need to send on demand, send 10 and as you release, send more.... how can I do ? I set an example...…
-
2
votes1
answer63
viewsDifference of calling a function in Dllmain by Createthread or calling directly
What is the difference of calling a function in the following ways: The first way creating a thread. Example: DWORD WINAPI Metodo1(LPVOID) { // Meu código aqui... return NULL; } int WINAPI…
-
2
votes1
answer1234
viewsThread - How to Call a Form within an iTask Thread?
In Delphi 10.2, I have a Form A that has a Ttask "Task-A" that fires a Storedprocedure in the Oracle bank with Firedac. Storedprocedure updates a table of results that will be used by a form B which…
-
2
votes1
answer57
viewsonSpinWait Java 9
I am porting a Java 8 application to 9, I have some processes that use the concept of Watchdog, who use something similar to: public synchronized void run() { until = System.currentTimeMillis() +…
-
2
votes0
answers595
viewsTraffic Light Problems (Readers and Writers)
I am trying to implement the problem of readers and writers in Java, and for this I am basing myself on the method used by Tanenbaum in the book Operating Systems. With only one writer thread and…
-
2
votes1
answer395
viewsCalculate Factorial Array using Thread’s
I’m having problems in the following exercise Write a program that, given a vector with the first 5 numbers primes, pitch 5 threads. Each of them will calculate the value of the factorial of one of…
-
2
votes3
answers3721
viewsWait for Thread to finish to proceed with the code - Delphi
I’m facing a problem in an application that I developed. It is an automatic updater that basically downloads the necessary files and extracts them in a suitable path. The problem is time to…
-
2
votes1
answer236
viewsProblems with C++ threads
Hello, I’m using mingw, 32-bit version in windows 7 Ultimate and I’m having trouble using threads. I know they don’t work for this version of mingw, which is why I use the version in this link. But…
-
2
votes0
answers39
viewsThreading Problems in Windows Form
I’m trying to implement Threads in my algorithm, however when adding and running my software the Windows Form of it hangs and does not perform any action, can you see anything wrong in the code…
-
2
votes0
answers57
viewsThread in eternal Wait state, does not wake up with the notify
Good morning, I’m having a problem in a project involving Threads, I’m starting to mess with Threads right now in a college job and I’m having doubts about Thread being in the state of "WAINTING"…
-
2
votes1
answer93
viewsWhy does my synchronized method not work as expected?
I have a class called GerenciadorServerSocket: @Service public class GerenciadorServerSocket { private CopyOnWriteArrayList<Integer> portasUsadas = new CopyOnWriteArrayList<>(new…
-
2
votes1
answer54
viewsHow to lock a method so that others do not call while it is used?
I have a simple method of log, which adds some lines to a special file. The problem is, the application is multi-threading, and in each Thread is called this method to log, and when one is called,…
-
2
votes1
answer123
viewsSocket with threads in Java
I have this code that involves socket TCP and threads. How do I get the server to send a message when the client connects? In this case the client sends the message and the result has to return to…
-
2
votes0
answers22
viewsJava with Javafx
People I’m trying to make a thread call when opening the customer registration screen, but my screen is not opening, someone can help?? @FXML void OpenCliente(ActionEvent event) { try { //CREATING A…
-
2
votes1
answer61
viewsSynchronization Java Web Method
I have a web application selling school canteen product, this process is accessed by several users simultaneously.. I have a method that updates and validates if quantity is available.. I need this…
-
2
votes1
answer181
viewsHow to control multithreading in parallelism?
I’ve tried using the methods wait() with notify and even the depreciated methods stop(), and did not succeed. I have three (3) threads which are: Tankcontroller Faucetfill Faucetempty What I’m…
-
2
votes3
answers623
viewsWait Thread Finish to continue code - Delphi
I need to wait for select and fill the list to finish in Thread for Function Result to receive the list loaded in the asynchronous method, is it possible? Follow the code of Function: function…
-
2
votes0
answers68
viewsWhat is the ideal way to close a C++ thread
I’m trying to close a thread, but it appears the message "Process terminating with default action of Signal 6 (SIGABRT)", with memory error including Leak. How hard I try to execute: valgrind…
-
1
votes1
answer63
viewsCapture messages update automatically in front-end
I would like to know how the process of capturing updates of messages and posts (back-end) is done automatically by the font-end (Like the one performed by facebook). Anyone have any idea? This is…
-
1
votes1
answer142
viewsMultithreading Doubt in C#
I have the following scenario: Three types of threads can be created in the program, imagine they are, A, B and C. I have to respect the following rule: A thread C not can access the critical region…
-
1
votes1
answer119
viewsC# Manualresetevent
What good is the code below the Manualresetevent connectDone? If I use it, when running the main thread hangs, as I am using this code within the Unity3d(game engine) it hangs the entire process and…
-
1
votes1
answer460
viewsCheck C#threads
I am trying to understand the code below, but without success. From what I’ve researched, GetMaxThreads returns maximum available threads and GetAvailableThreads what is available. In the case of…
-
1
votes1
answer252
viewsGenerate a report using thread in the background
I want to generate a report, but I want the system to be free for the user to do other activities while there is no report return. For this I am using thread, only when I close the form is giving…
-
1
votes1
answer1948
viewsCan you kill a thread in Python?
Is there any way to stop a python thread? And it’s a bad practice to do that?
-
1
votes1
answer1505
viewsHow to run multiple threads sequentially?
I have to run a thread x and let the thread y start only when x is done, regardless of how long it will take, and then run z only when y is done. Does anyone know the best way to do this? Thanks in…
-
1
votes0
answers196
viewshow to perform all tasks at once?
I can’t get you to perform all these tasks at the same time, only perform the rest when you get some data on InputStream. And once he gets that data, he doesn’t get any more. Please help me, I’m new…
-
1
votes1
answer262
viewsAccess Violation when creating Thread
I’m getting the bug: Acess Violation at address 00420214. Write of address 0000000E. When creating a Thread. The error line is exactly the creation line (marked with '>'). In uses I added the…
-
1
votes2
answers634
viewsStart multiple threads in a repeat command
I have a project where I need to start 30 times a thread which will run the same method, and wanted to do this in a repeat command, for example: for (int i = 0; i < 30; i++) { Thread t = new…
-
1
votes1
answer155
viewsThread starts but there is no reaction
I’m in a little trouble that when I start one thread with a normal function or the tasks of the thread are fully completed and the thread is finalized! But I need to start one thread that causes a…
-
1
votes1
answer1626
viewsMessagebox with autoclose
I’m having some problems with an application I created, using C# and Windows Forms, and the situation is as follows:: The app is a chat. It does not keep record of conversations; When the…
-
1
votes1
answer116
viewsUse of threads in C# without storing in variable
If I start a thread anonymity: new Thread(chat).Start(); and would again instate it in the same way, it overlap the other thread? If not, how should you give a "Kill" in the first thread in…
-
1
votes2
answers96
viewsHow to debug errors in Realm DB?
How can I debug this error and know its origin: lib c++Abi.dylib: terminating with uncaught Exception of type Realm ::Incorrect threadexception: Realm accessed from incorrect thread.…
-
1
votes1
answer1641
viewsPost method with idhttp without locking
Hello, I will explain more or less what I wish to do, I have some data that need to be sent by post method to a server, but whenever it makes a upload the program "Freeza"(program crashes quickly),…
-
1
votes1
answer110
viewsView Spinner Progressidialog?
Well I need to do a long task so I did a Progressdialog to inform such task, however the spinner that should be appearing seems hidden or something. protected void onPreExecute (){…
-
1
votes3
answers1710
viewsWhen and why should we use threads?
When and why should we use threads? I’d like a few examples.
-
1
votes1
answer47
viewsMy Thread only runs 2 times
I have a method that takes several files from a directory lists them in a table and generates a report for each file. I put a thread in this method and now it only picks up 2 files and stops. Where…
-
1
votes2
answers40
viewsThe functions do not end
After the execution of the 4 functions it should print the time it took to execute public class main { public static void main(String[] args) { long init = System.currentTimeMillis(); ataque1();…