0
votes
2answers
34 views
Parallel version of Files.walkFileTree (java or scala)
Does anyone know of any parallel equivalent of java Files.walkFileTree or something similar? It can be Java or Scala library.
0
votes
1answer
19 views
Jprogress Bar and concurrency
I know there have been tons of questions regarding this, and I went through most of them in the past 2 hours looking for a working answer, none made it.
My dilemma is that I am making a geocoder. My ...
0
votes
0answers
17 views
MultiThreadedMapper refuses to find Jar
For some reason everytime I run this program (both on eclipse and on EMR) I get the message 13/07/18 13:22:23 WARN mapred.JobClient: No job jar file set. User classes may not be found. See ...
3
votes
3answers
46 views
coding a proof for potential concurrency issue
I'm reading "Java Concurrency in Practice" and trying to write a piece of code that will show that the class presented as an example in chapter 3.5.1 can indeed introduce problems.
public class ...
2
votes
3answers
69 views
Java Threads and Shutdown Hook
I've just run into an interesting issue. It seems that if, in Java, a thread calls System.exit() it cannot then be joined via Thread.join().
This is causing me issues as I want to use a shutdown hook ...
2
votes
0answers
85 views
Running two tasks simultaneously in Java
I have two tasks that should be run together.
The first task to save the data to the database. And the second task of recording video.
Currently I use a Thread for each task, and run it ...
2
votes
3answers
53 views
Allow multiple gets for synchronized getter/setter
A common way of gaining access to a field is to synchronize the getters and setters. A simple example with an int would look like:
private int foo = 0;
public synchronized int get(){return this.foo;}
...
0
votes
1answer
32 views
Code fault of falseException in thread
I get a "falseException" while running the following code:
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import ...
0
votes
3answers
33 views
BlockingQueue Behaviour for Multiple Request
I am Sorry if my Question is Silly.
I am using ArrayBlockingQueue.
private ArrayBlockingQueue<RequestParameters> processorQueue;
private int sizeOfQueue = 3000;
Here, my Producer is seperate ...
0
votes
3answers
92 views
confusion regarding multithreading
I am actually very beginner in java field and currently going through multithreading concepts
I came across a program and had certain doubts regarding the program itself.
Following is my program
...
0
votes
1answer
28 views
Start swing gui in anouther thread different from main to update jtextarea while doing culculations
My program starts at the moment
public static void main(String[] args){
new Gui().setVisible(true);
new Program(); }
I am using Jtextarea to display results.
I have ...
0
votes
1answer
23 views
Simultaneously downloading of webpages/files in EJB(java)
I have a small problem with creating threads in EJB.OK I understand why i can not use them in EJB, but dont know how to replace them with the same functionality.I am trying to download 30-40 ...
1
vote
2answers
56 views
Proper way to handle file writes in separate threads
I am looking to write to files multiple times (100k+) and the writes will happen over a flaky network. So to do this, I am considering using the Java ExecutorService to help generate threads, but I'm ...
0
votes
3answers
97 views
Calling functions from threads
I am beginner in java. I have been studying multithreading. I want to create two threads and these two threads must run separate methods concurrently. Here these threads should call sum and diff ...
-7
votes
1answer
40 views
new Thread(runnable, name) return null [on hold]
I have a problem with a multi-threaded application, bound to button stop thread
thread = NULL;
after that I start another thread (using the same variable)
thread = new Thread(this, "game");
...
1
vote
2answers
41 views
all my methods on button click wait for the thread to complete before actioning
I am new to Java and I am currently trying to build a port scanner for my University course. I have got the majority of it to work although I am having a problem with the UI. I have set my button text ...
0
votes
3answers
51 views
Notification in Java thread synchronization
When there are multiple threads in waiting state; and if I call notify() rather than calling notifyAll() Which one is going to be notified among several threads in waiting state?
0
votes
2answers
53 views
Java Thread Concurrent Read and Write
I have a arraylist which store data i received and transmit asynchronously over bluetooth.
I have a write thread and a read thread to access the arraylist. I am trying to simulate bluetooth echo (The ...
0
votes
3answers
17 views
Android BroadCast Receiver Thread to notify sd card removal
I need help implementing a broadcast receiver that will run on a seperate thread started through an activity to notify SDCard Removal or unmounting. Can someone guide me on this please
Thank you
2
votes
1answer
70 views
How can i run the task only once in this task
I have this below piece of code inside my WebApplication , which basically does this , whenever a user logs into the Application .
The addSymbols Method will be getting called during user logon ...
1
vote
1answer
68 views
Read and write into shared thread variables
first of all i am new to threads and shared variables. So please be kind with me ;-)
I'm having a class called Routing. This class recieves and handles messages. If a message is of type A the ...
0
votes
1answer
27 views
how to correctly close SocketChannel java in JAVA?
I am developing multithreading non-blocking tcp server and client in Java. I have a problem with the server realizing that the client socket is closed. For him it's allways open. Here is the code and ...
-2
votes
0answers
25 views
How many ways we can achieve thread in android and what is better to use [on hold]
I wanted to know how many ways to achieve the thread in android, and which one is good to use, and what is differences between them.
0
votes
2answers
49 views
When you close a GUI with the little X
If you close a GUI using the the little X in the top right of the form, does that kill all your threads as well?
If not, how to you catch that event so I can put in some close down code?
0
votes
1answer
30 views
How to update a JApplet GUI within a thread?
I'm having problens in updating a JLabel inside a JApplet. I'm using SwingUtils.invokeLater but it doest not working when Applet is inside browser. When I test it on NetBeans Applet Viewer it works ...
1
vote
2answers
25 views
ScheduledThreadPoolExecutor.remove : Is it safe to use
i am trying to schedule bunch of tasks to execute periodically. under certain situations some task need to be stopped from scheduling, so i remove them from the interal queue of threadPoolExecutor. I ...
0
votes
0answers
28 views
Pool of worker thread and background thread in java
I have a web service(Java) in which I have the 3 tasks
Task 1:hit the server 1 and get the response res1
Task 2: hit the server 2 and get the response res2
Task 3: hit the server 3 and get the ...
4
votes
1answer
54 views
Binary Semaphore vs a ReentrantLock
I've been trying to understand Reentrant locks and Semaphores ( the nesting of Reentrant locks vs release/unlock mechanism ).
It seems that having a Semaphore requires you to write a more thoroughly ...
0
votes
2answers
42 views
Is it possible to re-use a Runnable containing closures
I'm using libgdx for a game I'm writing, where I have another thread that needs to update the graphics thread. I was getting crashes as libgdx is not thread safe (intentionally) and I was allowing ...
0
votes
2answers
43 views
How to specify the type of threads between which an exchange takes place using an exchanger?
I have two Runnable classes, Reader and Writer.
import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
import java.util.concurrent.Exchanger;
public class Reader ...