Most voted "multithreading" questions
Multithreading is a popular programming model that allows multiple line execution within a simple context, sharing process resources, and capable of running independently.
Learn more…199 questions
Sort by count of
-
4
votes2
answers1328
viewsIs it safe to use List with Parallel.Foreach?
I’m making one by making a style method Crawler which receives a string list, makes a call on a website, inserts the return into another list and returns. My method is working, but it’s too slow, so…
-
4
votes2
answers890
viewsHow to add parallelism in execution with the subprocess module?
The code will be used in 2 testing virtual machines (Linux and Windows). The code below works but every time I run a program, for example the notepad, the prompt is stuck until I close the program.…
-
4
votes1
answer160
viewsUsing Callable in java runs code sequentially
I am making a server in java wanted to perform certain tasks in parallel. I have a list of a certain type I want 20 threads to deal with elements of the list. for( Item item : result ) {…
-
4
votes2
answers1858
viewsFiredac multithread (Simultaneous connections - REST server) DELPHI
Good morning Personal, I’d like to request some help from you, in case anyone can help I’m super grateful. Doubt would be reasonably simple, how to work with Multi Thread in Firedac? In other…
-
4
votes1
answer83
viewsWhat is the need of a while in a producer-consumer?
I’m used to programming using this while in problems involving synchronization of threds because that’s how API’s usually ask you to do it, but I’ve never wondered why it is. I am taking a course of…
thread multithreading operating-system synchronizationasked 5 years, 9 months ago Michael Pacheco 1,657 -
4
votes1
answer68
viewsIn Assumptions on Timing - I don’t understand this concept of a book
Cited in the book that a critical region has 4 key points: Progress: Ensures that all threads are entering and leaving the critical region, avoiding deadlocks. Mutually Exclusive: Only one thread…
-
3
votes1
answer737
viewsLoop asynchronous calls and process data at the end of all runs
I have a method of web service which receives the IP of a server as a parameter and returns a DataSet. Several servers must be consulted by this web service, Um List<string> contains the list…
-
3
votes2
answers429
viewsRun N threads and know when all finished running
I have the following problem, I need to run the same method N times in a for and know when all the threads they’ve finished running it. I needed something like this: foreach (MeuObjeto obj in…
-
3
votes2
answers2519
viewsThread containing connection components to the database generates an exception when they are released from memory
I needed to add some threads to carry out certain processes in the background. This thread accesses the methods of a Webservice and also performs operations in the database. I create all the objects…
-
3
votes1
answer250
viewsMulti-processing/Multithread not working
I want to try to solve the problem of when the client cannot connect to the server(connection failure, server below, etc). In my main class is the connection to the server and I want in case of…
-
3
votes1
answer933
viewsSynchronize Threads
I have a 3-thread application, this application involves a chemical process simulator, and I have to take some values of these processes. values come in a single object. The 3 threads make an…
-
3
votes1
answer3368
viewsImplement Runnable or Thread Extension?
In several Java projects, I’ve seen these two ways to create Threads: With implements Runnable: public class MyRunnable implements Runnable { public void run() { //Código } } //Iniciada com uma…
-
3
votes2
answers997
viewsPossibility to schedule threads in Java to run at different times
I have a system multithreading which is the same as the topic post link - Java Thread Sync (sync collections) in Java that allows scheduling threads to perform at different times. That way, the…
-
3
votes2
answers172
viewsWhat’s wrong with multi-thread implementation?
The implementation below is merely a test class to test competition in Java. Multiple Threads are created that execute a method that adds up, then a return is displayed showing the sum result.…
-
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
votes0
answers136
viewsMultithreading Crawler problem using jsoup
Hello, I’m developing a multithreaded Crawler, each job (thread) deals with X sites to analyze certain content with the jsoup lib. The sites are all accessible. The problem is that the final results…
-
3
votes1
answer64
viewsperform . Globalenv function in parallel processing
I need to execute a function that is in . Globalenv in a parallel processing using the multidplyr package. Using a simple example without parallel processing, it works as expected: library(dplyr)…
-
3
votes1
answer762
viewsImplement Thread in Python
Following the theory of this question and answer I understood that I can run more than one program, right? I have a database with more than 3,000 users to check, this check works as follows, it…
-
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
votes1
answer69
viewsMultiple threads can interfere with timerControl
I am developing a program that contains more than 10 threads running ... has emerged the need to have two timers, one to block and the other to release a process, so I am using Winforms timerControl…
-
2
votes1
answer384
viewsUsing classes from the java.util.Concurrent package to multiply matrices on android?
I was doing this program to multiply matrices, I saw that it correctly calculates the result, but there is no performance gain by putting more threads, often even worse performance despite running…
-
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
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
votes1
answer2831
viewsWhat are Java daemon threads and when to use them?
From the Java documentation I follow the following excerpt: The Java Virtual Machine exits when the only threads running are all daemon threads. But it’s still unclear to me when to set a thread as…
-
2
votes1
answer183
viewsHow do you call a function without waiting for it to end?
I need to call a function in PHP that records several records in the database which will take a long time, I need it to do in "background" while PHP does something else, is it possible? If yes, how…
-
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…
-
2
votes1
answer48
viewsNullpointerexception when connecting the server
I am making a program in Java server/client. When I start the server class I see the error Exception in thread "Thread-0" java.lang.Nullpointerexception I leave the code below so you can help me…
-
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
votes3
answers1401
viewsHow to access object created by another thread?
It is possible to access an object created by another thread?
-
2
votes2
answers1285
viewsNumber of simultaneous requests a PHP server supports
Let’s say I have a server with a 4-core/8 i7 processor threads. In an architecture multi-threaded, assuming that a thread by request, only 8 simultaneous requests will be allowed, since the…
-
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
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
answer464
viewsError returns when trying to start some threads in a list
I need to create a function for my program, which when the user is pressing the NUMPAD_8, he shut down all the thread, and if he squeezes again, he turns them back on. How I’m creating the thread…
-
2
votes1
answer673
viewsSet timeout on thread execution and save return value
Hello, I have a web service, with backend in java 7. At some point, the backend makes a broadcast RPC call to N servers that are listening. Except that there is no predefined timeout in the call, I…
-
2
votes2
answers265
viewsUnexpected result in using Parallel.Foreach
Next, I have a class that has a string list and the following structure public class Teste { private List<string> _codigos; public void InsertDB(string[] files) { _codigos = new…
-
2
votes2
answers1256
viewsClient and server programming: How to achieve numerous data exchanges per client and multiple clients simultaneously?
The client: from socket import * serverHost = 'localhost' serverPort = 50007 # Menssagem a ser mandada codificada em bytes menssagem = [b'Ola mundo da internet!'] # Criamos o socket e o conectamos…
-
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
votes1
answer145
viewsInitialize and change static variable in a thead safe way. Does this code make sense? Intellij IDEA doesn’t think
Hello! I’m looking for a safe way to boot and change a static variable that will be shared by different threads that will be accessing its value. The idea is that, at some point, I will verify that…
-
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
answers321
viewsHow to Make Multiple Threads in a Java Loop
Description of the Problem I’m making a Pokedex, in which one of its features is to filter all the Pokemons of a certain type. I managed to implement this functionality, but the execution time is…
-
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
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
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
votes0
answers36
viewsWhat is the best way to use Firstchanceexception in multithreading application?
I have an application (which is a Windows service) that currently runs N Threads. What I want to do is capture whichever error that occurs in the application to write to a log file '.txt'. Only I…
-
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
answer114
viewsAsynctask canceled during execution does not call any of the post-InBackground() methods
When I cancel my AsyncTask running, it does not update the flag mAsyncTaskEstaFinalizada. Does anyone know what it might be? When I put breakpoints in the methods onCancelled(),…
-
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…