Questions tagged as 'multithreading'

1
answer

Implement Runnable or Extend Thread?

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 chamada "new Thread(new...
asked by 04.04.2017 / 16:50
2
answers

What is wrong with multi-thread implementation?

The implementation below is merely a test class to test competition in Java. Several Threads are created that execute a method that makes a sum, then a return is displayed showing the result of the sum. According to the values already implemente...
asked by 09.04.2016 / 21:03
2
answers

Execute N threads and know when they all finished executing

I have the following problem, I need to run the same N method in a for and know when all the threads have already finished running it. I needed something like this: foreach (MeuObjeto obj in lstObj) { new Thread(delegate() { Me...
asked by 11.04.2015 / 01:06
2
answers

Thread containing database connection components throws exception when they are released from memory

I needed to add some threads to perform certain processes in the background. This thread accesses the methods of a WebService and also performs operations on the database. I create all the objects I need to use in this thread within itself to...
asked by 06.10.2014 / 18:59
2
answers

Possibility to schedule threads in Java to run at different times

I have a multithreading system that is the same as the post link - Java Thread Synchronization (synchronize collections) in Java that allows you to schedule threads to run at different times. In this way, the agendarTarefa...
asked by 23.12.2015 / 08:12
1
answer

What are Java daemon threads and when to use them?

From the Java documentation I get the following snippet:    The Java Virtual Machine exits when the only running threads are all daemon threads. But it's still not clear to me when I should set a thread as a daemon or not. Would anyone ha...
asked by 18.12.2015 / 00:36
1
answer

execute .GlobalEnv function in parallel processing

I need to run a function that is in .GlobalEnv in a parallel processing using the multidplyr package. Using a simple example and no parallel processing works as expected: library(dplyr) library(purrr) library(multidplyr) data.frame(x = 1:1...
asked by 21.02.2017 / 19:24
1
answer

Loop asynchronous calls and process data at the end of all executions

I have a method of a web service that receives the IP of a server as a parameter and returns a DataSet . Multiple servers must be queried by this web service, A List<string> contains the list of IPs. A loop executes the meth...
asked by 26.02.2014 / 15:57
1
answer

Synchronize Threads

I have an application with 3 threads, this application involves a chemical process simulator, and I have to pick up some values from these processes. the values come in a single object. The 3 threads make an infinite loop, in this loop they t...
asked by 17.12.2014 / 13:52
1
answer

Multi Processing / Multithread is not working

I want to try to solve the problem of when the client can not connect to the server (connection failure, server down, etc.). In my main class is the connection to the server and I want that in case of giving error caught by try ... catch(C...
asked by 04.11.2014 / 12:11