Questions tagged as 'multithreading'

2
answers

Draw a pixel-by-pixel image

I'm trying to do a beast program but I can not do it. I want to redraw a pixel-by-pixel image randomly, doing this with multiple threads. I do not handle much of Java Swing, so I'm beating myself a lot. I did some research before postin...
asked by 09.10.2014 / 15:23
1
answer

Initialize and change static variable in a safe way. Does this code make sense? Intellij IDEA thinks it does not

Hello I'm looking for a secure way to initialize 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 check that this variable needs to be changed a...
asked by 13.06.2018 / 15:00
1
answer

Set timeout on thread execution and save return value

Hello, I have a web service, with a backend in java 7. At some point, the backend makes an RPC call in broadcast to N servers that are listening. But there is no pre-defined timeout on the call, I have no way to control the response time of...
asked by 12.10.2017 / 00:04
3
answers

How to access object created by another thread?

Is it possible to access an object created by another thread ?     
asked by 17.04.2017 / 06:20
1
answer

Java: 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, forwarding it to the right Client. I am an error:...
asked by 05.12.2015 / 22:50
1
answer

NullPointerException when connecting to server

I'm doing a server / client Java program. When I start the server class I get the error    Exception in thread "Thread-0" java.lang.NullPointerException I'll leave the code below to help me solve the problem: public class Servidor imple...
asked by 14.12.2015 / 14:08
1
answer

Using classes from the java.util.concurrent package to multiply arrays in android?

I was doing this program to multiply arrays, I saw that it correctly calculates the result, but there is no performance gain by putting more threads, often even worsening performance despite being running on a quad-core smartphone. I would like...
asked by 10.11.2014 / 14:43
1
answer

Multiple threads may interfere with the timerControl

I'm developing a program that contains more than 10 threads running ... there was a need to have two timers, one to block and one to release a process, so I'm using the WinForms timerControl ... which initially are: timer.Enable = false /...
asked by 15.08.2014 / 19:32
0
answers

How to do multiple Thread in a Java Loop

Problem description I'm doing a Pokedex, in which one of its functions is to filter all pokemons of a certain type. I was able to implement this functionality, but the execution time is not good ... It takes about 25 seconds to go through...
asked by 03.11.2018 / 20:11
0
answers

Problems with Threads in Windows Form

I'm trying to implement Threads in my algorithm, but when I add and run my software the Windows Form of it hangs and does not take any action, can you see something wrong in the code below? I know there is Async/Await to be...
asked by 12.08.2018 / 06:14