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
-
3
votes1
answer717
viewsHow the Node thread pool works
Assuming that Javascript, both in browser and Node, is single thread (correct me if I’m wrong), like thread pool works? If, for now, my server does not receive many requests or is in development (it…
-
3
votes1
answer60
viewsWhy do you have to add -pthread option when compiling with the Std thread library?
If in the main.cpp I use the library thread of std, to compile I have to use the following command: g++ main.cpp -pthread And even applies to Ang. This is the only case I know of the standard…
-
3
votes2
answers425
viewsAsynchronous alternative to Thread.Sleep without locking application in C#
Sometimes we want our application to wait a few moments to proceed with the next instruction, however the Thread.Sleep(0) can cause crashes in your application, mainly using in loops. So here’s a…
-
3
votes1
answer74
viewsError creating thread inside a Handler
I need to delay 5 seconds in one of the parts of my application: final Runnable runnable = new Runnable() { @Override public void run() { // Encadeia trabalho serializado jobChain.append(new Job() {…
-
3
votes1
answer52
viewsXAML with parameter - Backgroundworker
I’m doing a small XAML application that asks for 2 dates. Dates are passed as a parameter to some methods invoked by the Event click button. The problem is that during the execution of the methods…
-
3
votes3
answers550
viewsPrint the Thread ID
I have the following code and cannot print the Thread ID, only the size. How do I print the thread array ID? public class MultiplicacaoMatrizesThread { // Matriz A public static int a[][] = { { 5, 4…
-
3
votes1
answer162
viewsThread of a "flashing" dot
Hello, I made a program that moves a ball with the arrow keys on the keyboard only that keeps blinking the screen when it moves. I’ve seen other programs in this kind of mine that don’t keep…
-
3
votes1
answer391
viewsDoubt with Thread
I have a form where I have a Thread to update some images, calling her using a timer interval 19000, but it’s generating me the following ERROR only when called by timer. Project Sistemaa.exe Raised…
-
3
votes1
answer100
viewsWhat do Threads share when making Http calls?
The problem: I can’t login to a site more than once on Threads different. My application is a Console application. If I open several executable, can each do successfully login in one Thread, only…
-
3
votes1
answer667
viewsSemaphore and Mutex in C
I have the following problem: A LAN house with 3 pcs, I will insert an X value in the terminal that will be the number of clients arriving in the lan house, customers can only use the Pcs that are…
-
3
votes2
answers294
viewsDo threads share the same memory address as an object method?
I searched here in the O.R.. I have a program in Java that makes use of Threads. public class Objeto { int i; public Objeto() { i = 0; } public void Foo() { i++; System.out.println("Aqui " + i); } }…
-
3
votes1
answer67
viewsHow to write this java program using javascript and Node?
public class Principal { private static int x = 0; private static int y = 0; public static void sum() { x = y + 1; y = x + 1; } public static void main(String[] args) { for (int i = 1; i <= 10;…
-
3
votes2
answers510
viewsCreate class instance in threads
Imagine I have a class: Class Animal { //Propriedades } Now creating multiple instances of the class I do as follows: Animal[] animais = new Animal[10]; for(int i = 0; i < 10; i++) { animais[i] =…
-
3
votes1
answer61
viewsHow does the operating system distribute the processor across the various programs?
In current operating systems there is possibility of having several programs running. It is the work of the operating system to ensure that all programs have opportunity to perform work (process…
-
3
votes1
answer1356
viewsPython serial vs multiprocessing vs threading code
I’m using python version 3.4 How do I find out that my codes are actually working and doing what they’re supposed to? When looking at the System Monitor (linux) I noticed that codes using…
-
3
votes1
answer1156
viewsUnable to create an instance of Activex control because the current thread is not in an STA
I’m trying to access a website through Webbrowser and this morning, suddenly, the following error appeared Unable to create an Activex control instance '8856f961-340a-11d0-a96b-00c04fd705a2' because…
-
3
votes1
answer568
viewsAccess a C# thread-based method object with Winforms
I created a thread to run a process that takes too long and makes the application process stop for a great while private void ExeConsultaClientes() { thread = new Thread(new…
-
3
votes0
answers1472
viewsSystem.Threading.Threadabortexception: Thread was being undone. While consuming webservice operation
I have the following code: proxy_hom_recepcionarLoteRps.RecepcionarLoteRPS proxy = new proxy_hom_recepcionarLoteRps.RecepcionarLoteRPS(); proxy.Url = url + "/arecepcionarloterps"; string resp =…
-
3
votes2
answers59
viewsHow to instantiate objects in shared memory?
I have an application in which there are several parallelization modes. However, when I will parallelize through Fork() the barrier is not shared between processes, there is some difference of the…
-
3
votes1
answer198
viewsHow to Suspend a Process-Specific Thread (.exe) in C++?
I want to suspend a specific thread from a C++ process by Startaddress. My code already suspends some threads of the process, but others do not... It seems that this only happens to address that…
-
3
votes1
answer209
viewsIs there a thread, pipeline and core relationship?
Is there any relationship between these elements (thread, pipeline and core of the CPU)? I saw that the pipeline helps a lot when you need to perform many tasks, thus making it easier to harness the…
-
3
votes1
answer196
viewsHow to see the cpu usage percentage of each thread of a java process
Well, I have a cpu usage problem, and I don’t know exactly which class or Thread you are consuming ( there’s no way to know externally the code ), I was wondering if you have any method that shows…
-
2
votes3
answers1447
viewsFork in Join in Java
During a project I was suggested the use of Fork in Join of the Java API instead of threads, I found nothing easy to understand by the examples found on Google. I understood that it is possible to…
-
2
votes4
answers2018
viewsHow to use a class-specific thread with multiple threads?
I’m with a class called Ball where I have a thread that makes some balls move in phase 1 of a game. It is possible for me to implement in this same class another thread make the balls move…
-
2
votes1
answer144
viewsHow to declare a method to be executed from time to time in an ASP.NET application?
I have an application ASP.NET Webforms and need to create an event to run at certain times. The event is about sending emails. I think I read somewhere about IIS download the memory application when…
-
2
votes1
answer2006
viewsHow to wait for a Thread to finish and how to receive values from it?
I am working on a situation that requires the use of multiprocessing. I need to read files and a shitload of lawsuits that could take some time. During this process, I want to display a kind of user…
-
2
votes1
answer641
viewsA little more about File.Writeallbytes
How to display progress by synchronizing the following function: File.WriteAllBytes(string path, byte[] content); This method should be called according to a System.Threading.Thread Ex: Thread wnd;…
-
2
votes1
answer347
viewsRestart requestLocationUpdates() with Sleep
How do I start the requestLocationUpdates() with Thread.sleep(); in the Android? My code: public void onLocationChanged(Location loc) { Date d = new Date(); SimpleDateFormat sdf = new…
-
2
votes1
answer519
viewsPing - store positive results in a list
I have this code, it’s working fine, but the problem is that I would like to save the hits (ping with feedback) in a list, but I don’t know how to do this screening successes/failures. import…
-
2
votes1
answer119
viewsC# Threads How to optimize a SELECT with BLOB
I have an application in C# (.Net 4.5) that when loading a screen among other operations it looks for a background image and sounds in the database. It happens that for some screens loaded this…
-
2
votes1
answer45
viewsDynamic Waitforexit process.
I wonder if there is any way to know if the process came out, even continuing the implementation of the project. When using Processo.WaitForExit it to the application, its execution is stopped. I…
-
2
votes3
answers603
viewsMultithread in web application
I have an app that does some server processing and then delivers it to the client. Something like: http://aplicacao:8080/app/videos/extrair/{id}. Where the "id" is the item reference for processing.…
-
2
votes1
answer572
viewsObject-Oriented Multithread in Native C++11?
How is implemented the Multithread Orientado a Objetos in C++11? in java this is possible through the Class Extension Thread / Implementation of the interface Runnable and overwriting the Run Method…
-
2
votes1
answer1878
viewsRun Time Java Method in Time - Run Periodically
How do I run a method of a Java class of x x in x time in Weblogic? From what I have been checking, there is the possibility to use the @Schedule annotation in the method (Java EE 6). But since I am…
-
2
votes2
answers1749
viewsDraw a pixel-by-pixel image
I’m trying to make a stupid little program but I’m not getting it. I want to randomly redraw a pixel-by-pixel image, doing this with multiple threads. I don’t know much about Java Swing, so I’m…
-
2
votes2
answers329
viewsHow to know when two Threads ended up in Swing?
I have a method that performs two tasks. I would like two threads perform each task. Tasks do not share data, are completely independent. Before starting the tasks is shown a dialog with the…
-
2
votes2
answers156
viewsUse separate threads or programs?
I’m developing an application that involves three (maybe more) processes that run simultaneously: an HTTP server, a logger and another that will run the main code. A priori, a simple solution to do…
-
2
votes1
answer126
viewsIs there any way to start a Thread that is in a method in another class?
I have a method and within it a thread, I needed to "startar" it from another class and then check when Thread ran out. Is it possible to do this? my code: Thread th; public void inserir(){ th = new…
-
2
votes3
answers1110
viewsI have 5 threads running in parallel. How do I know when they’re all gone?
If I make one join for each of them, they will perform in sequence, one at a time. I needed to start the 5 in parallel and know when they all finished to do something. Does anyone know if and how…
-
2
votes1
answer109
viewsDo HTML "script" tags get "thread" unique to each one in the browser?
Separate Javascript processes in tags <SCRIPT> are worthwhile for the individual processing of each programming, or the browser joins everything in a single process? Someone who really…
-
2
votes1
answer527
viewsjava.lang.Nullpointerexception in this code
This gives java.lang.Nullpointerexception error in these two classes. import javax.swing.JButton; import javax.swing.JPanel; import javax.swing.JTextArea; import javax.swing.JTextField; public class…
-
2
votes1
answer238
viewsDependency Error
I’m using the BackgroundWorker private BackgroundWorker BGWorker = new BackgroundWorker(); BGWorker.DoWork += BGWorker_DoWork; BGWorker.RunWorkerAsync(); private void BGWorker_DoWork(object sender,…
-
2
votes1
answer1874
viewsHow to use thread in Javafx?
Before appearing the main scenario of my Javafx application, I want a class containing a presentation to appear; I’m unable to use the method sleep. A stage blank and then the class containing the…
-
2
votes2
answers292
viewsHow to reuse a pthreads?
I’m using pthread.h and using the following functions: // // Cria A thread // thread_argsPP[contthreadsPP] = contthreadsPP; pthread_create(&threadsPP[contthreadsPP], NULL, ReceivePinPad, (void…
-
2
votes0
answers149
viewsHow do I get the form to update correctly?
I have a screen in Delphi that is constantly updated, is used along with a ratchet, every time a person puts the digital or enters the password, this screen is updated with the information of this…
-
2
votes1
answer495
viewsTask.Run locking inside a "tick" (Forms.Timer)
In my application, I created a "Timer" (System.Windows.Forms) that runs every 1 second. In the "tick" event, I placed a await Task.Run. For some reason the tick stops running after a while (because…
-
2
votes1
answer52
viewsWhat happens after Wait synchronization?
Look at these two codes in separate threads Thread A synchronized(objeto) { while(condicao) objeto.wait(); //operações } Thread B synchronized(objeto) { condicao = false; objeto.notify();…
-
2
votes1
answer74
viewsAccess a method that is outside the thread
I have a video running in my application and a Thread running a Socket(server), all within the same class, but I need this Thread to access a method that is outside of it. To be more exact I want to…
-
2
votes1
answer202
views -
2
votes0
answers78
viewsReuse of threads
I’m making an addon for nodejs. One of the functions is responsible for parameterizing the incoming audio, from the various clients. I want this parameterization to be done in a thread. void…