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
-
31
votes1
answer5828
viewsDifference between Task and Thread
I need to create an executable c# and the question was: Do with thread or do with task? In practice there is some difference between using Task and the "traditional" multi-thread?? It is true that a…
-
29
votes3
answers19104
viewsUnderstanding threads in C#
I’m trying to figure out how to use Tasks and asynchronous methods in C#, but every place I see about it in internet mentions a "usual multithreading" form that would be different from the use of…
-
25
votes2
answers17812
viewsWhat is a Thread? How does it work?
I was confused as to what a thread is and what it represents. I found the following definition for the same: Thread is a small program that works as a subsystem, being a way for a process to split…
-
24
votes4
answers24580
viewsIs there a difference between Program, Thread and Process?
I wonder if there’s a difference between Thread, Process and Program? These three words are widely used in the area of Information Technology, so it would be interesting to know the difference…
-
22
votes3
answers10939
viewsHow does the C#lock work?
I was just looking at an article by MSDN, but it was not clear why to use this. class Account { decimal balance; private Object thisLock = new Object(); public void Withdraw(decimal amount) { lock…
-
17
votes1
answer410
viewsDiscrepant running times in parallel programming
I made a parallel code in C in order to verify its execution time. Was treated: Threads; Mutex; False Sharing; Synchronization. When executing the time of Linux with the execution of the code, in…
-
16
votes1
answer10829
viewsHow to make the app wait for a while?
It is common to have situations that we need to delay the execution of the code for a period, whether to show or delete a message or something visual shortly after, or to try something again, to…
-
14
votes2
answers3382
viewsWhat are the states of a thread?
I have been researching some places on the Internet but I did not find consistency in the definitions given on the subject of thread in Java. What are the possible states of a thread and what are…
-
14
votes1
answer356
viewsHow to release frozen/locked thread?
Studying on JS: Javascript - Thread, Asymchronism, Ticks How asynchronous programming works in Javascript? There is only one thread to execute your code, you need to avoid as much as possible that…
-
13
votes2
answers2425
viewsWhat is a state machine?
I’m doing a tour on the site, researching on asynchrony, threads, parallelism and the like. Upon finding this reply, I noticed that the author makes a quote about state machines. I didn’t understand…
-
12
votes2
answers1794
viewsHow to Thread a class method
I need to perform a parallel process using php, I installed the extension pthreads and I looked at some examples but didn’t see how I could implement it. Class: <?php class Negociacao{ /* Retorna…
-
11
votes1
answer1726
viewsDifference between Stathread and Mtathread
What is the difference between Stathread and Mtathread and when I should use one or the other? Why and how do they only concern the COM?
-
11
votes1
answer1156
viewsDifference between Pipes, Fork and Threads
From of that question, I was curious to learn more about the subject, so researching further, I came across more doubt on the subject. Because I saw that there is a string of ways to use Threads. We…
-
11
votes3
answers2839
viewsWhat is the solution for asynchronous PHP processes?
In PHP many times, in the middle of an operation, I need to send an email, make a call webservice or register a log, and these can sometimes take a while to process, but without having to wait for…
-
10
votes3
answers2338
viewsSplash Screen loading with application
My application, when starting, does the first search in the database. How I use the Hibernate, this first connection is a little more time consuming as it assembles the entire bank mapping. I’m…
-
10
votes1
answer1006
viewsChat Python - Errno 9 - Bad File Descriptor
I am developing (for study only) a code for a chat in python, and I came across an error during client-server communication, I would like some guidance about it, since I cannot identify a solution.…
-
9
votes1
answer907
viewsThread or Asynctask? When and which one should I use?
When it is recommended to use threads? At what point it is advisable to use the AsyncTask? I would like to know what to use and when to use it.
-
9
votes3
answers432
viewsJavascript - Thread, Asymchronism, Ticks
Situation Studying on Thread, I understood that they are lines of execution within a process. Studying on Assincronismo em javascript, I understood that it does not support multiple Thread, but has…
-
8
votes3
answers784
viewsSet the threads priority in C++11
In the program I’m developing I have two Std::threads that are always active throughout the life of the program. However, I consider that the role of one of them is of minor importance and would…
-
8
votes1
answer3212
viewsDelphi, Tthread.Que. What is it? When should it be used?
I was looking at this method that makes use of thread: procedure TFormClient.QueueLogMsg(const s: string); begin TThread.Queue(nil, procedure begin LogMsg(s) end ); end; What is this method…
-
8
votes2
answers1879
viewsWhat are the differences between background and foreground threads?
What are the differences between these two types of threads: background and foreground?
-
8
votes2
answers3923
viewsRun parallel process in PHP
I own a Web service that is consumed by some applications. On the Web service there must be the use of API of Amazon and perform a process whenever a record change is made via Web service. Initially…
-
8
votes1
answer10637
viewsThread Safe(TS) and Non Thread Safe(NTS) - What are they, what’s the difference?
When someone goes to download PHP, they have these 2 options: ts and nts, as well as language extensions. My doubts are as follows:: What are Thread Safe(TS) and Non Thread Safe(NTS)? There are some…
-
8
votes2
answers321
viewsAre static classes shared by threads?
Static classes, methods and properties are shared between threads of the application? That is, if I modify the static property foo in ThreadA, and then modify the same static property foo in…
-
8
votes6
answers1481
viewsLog system losing data, how to use Threads?
Currently I have a medium level system where I need to record detailed log of everything that happens in the system, the Company that is divided into Departments does audit of everything that…
-
8
votes1
answer290
viewsProgressidialog in C#
I’m trying to create a form similar to Progressdialog on android, in C#.. The idea would be that this would happen: //criar o controle na thread principal frmWaitingProgress fl = new…
-
8
votes1
answer517
viewsParallelize python Odd-Even Sort sorting algorithm
I have developed the following serial code to perform the Odd-Even Sort sorting, which first sorts even/odd and then odd/even. import time def oddevenSort(x): sorted = False while not sorted: sorted…
-
8
votes1
answer3990
viewsDifference between Thread.Sleep and Task.Delay
I am developing a client/server communication, and using Task for asynchronous communication. Previously, I had already made another communication where I used Thread, works smoothly and consumes…
-
7
votes1
answer239
viewsWhat is the Runloop?
I’d like to know what Runloop is in iOS and how it and the corresponding thread interact. It would also be interesting to understand how these two concepts interact with the autorelease pool.…
-
7
votes1
answer135
viewsUse of Waitall in C#
I have the following problem: A program generates two types of A and B threads through clicks on their respective buttons. The two types cannot run at the same time. If I have 10 A threads, B can…
-
7
votes3
answers3288
viewsWorking with delay’s on Android. Best approach?
Doubt I recently needed the use of a delay in my application to run certain code, after some time. Searching "over the internet", I found some "Gambi’s", and I found a somewhat new approach for me,…
-
7
votes2
answers5722
viewsWhat is the difference between Wait() and Sleep()?
The meaning of the two words seems very similar. What’s the difference between wait() and sleep()? When to use each?
-
7
votes1
answer589
viewsModify visual element by another thread
I want to define by a Thread the content in a Richtextbox but I get an error saying Cannot make calls from another thread distinguished from the same Textbox I have heard that it is possible to use…
-
6
votes1
answer374
viewsThreads running problem, using flags
I am having some problems in the complete understanding of the code because I am new to using java in thread. What code will do is control the flow, doing 55 iterations dividing between the thread…
-
6
votes2
answers2098
viewsHow to close a Jdialog after you finish running a Thread?
I have a configuration window that opens on the first run of the application I’m developing. After typing the directories that the application will run the user click save, some tests are run and…
-
6
votes1
answer1253
viewsThread Control in Java
I have a multi thread Java system that uses the class ThreadGroup which is deprecated. With my current implementation I can’t "kill" a thread in lock either. How to implement efficient code for…
-
6
votes2
answers1307
viewsWhat does a "Thread Safety" class mean?
According to the MSDN to Webapp Class (Microsoft.Owin.Hosting) is Thread Safety. What exactly does that mean? This class specifically has a method Start that: Start a web app.... Every request to…
-
6
votes1
answer550
viewsNumber of threads on a 16 processor machine
A question fell on my proof of Operating Systems and I was in doubt. During the race I got confused and marked alternative D, today I know she is wrong and has nothing to do with it. I am tending…
-
6
votes3
answers3964
viewsWhat is Threadpool all about?
I’m studying Threads in Java, and came across the following code: ExecutorService threadPool = Executors.newFixedThreadPool(10); for (int i = 0; i < 10; i++) threadPool.submit(new…
-
6
votes1
answer1243
viewsJava Thread Synchronization (synchronize collections)
I have defined a Thread in Java where I intend to simulate planes arriving and departing from the airport, the class Aviao contains only number and 10 passengers public class Aviao { //numero de…
-
6
votes1
answer527
viewsThreads Server Client
In the following class SocketServidor send a single thread with the out and the in, but this class is supposed to be able to send two threads when running. You’re supposed to do this: The server…
-
6
votes1
answer144
viewsWhat is the Join() function for in the threading module?
I’ve seen the function join() for the module threading, but I didn’t quite understand what she does.
-
6
votes1
answer342
viewsDifference in thread execution in Java
See the execution of two similar programs in Java. One inherits from Thread and another implements the interface Runnable: Program1: public class PingPong extends Thread{ private String msg; private…
-
6
votes0
answers75
viewsThread in WAIT state
I am monitoring a system that was made in Java and at certain times during the day the vast majority of Threads, about 95%, enter the WAIT state and are waiting for about 50 seconds on average, and…
-
5
votes1
answer1502
viewsWait to finish the thread before ending the program
I have a loop while that ends only when I press the key q, then the program is closed. Within that loop, at a given time or condition, I initiate a thread that takes about a few 10 seconds to run.…
-
5
votes1
answer560
viewsReport progress to the interface of an asynchronous method in C#
I have an app Windows Forms. This application will perform some processes that take some time to execute, so I would like to run them in parallel. Follows a little of what I’m trying to implement.…
-
5
votes2
answers718
viewsWhat is the most threads supported by Java EE?
I’m analyzing how to rewrite the architecture of a Java program I’d like to know how many threads the scheduler (Scheduler) supports? or how can I infer this amount based on the processing power of…
-
5
votes2
answers17150
viewsHow to create an Anonymous Thread in Delphi
I would like to know how to create an Anonymous Thread in Delphi, if you can show an example I would be grateful.
-
5
votes1
answer349
viewsDoes Task.Run always start a new Thread?
When executing a list of tasks initiated through Task.Run, it is ensured that each one is executed in a different Thread? When reading the documentation, it seems to me that this is the default…
-
5
votes2
answers828
viewsAbort Thread through another C#process
I am developing an application in ASP.Net 5.0, where it needs to start a task through a Thread Secondary, as the example below: //Inicia processo de pesquisa var ppBlo = new ProcessoPesquisaBLO();…