4
votes
2answers
143 views

Java HTTP Server and multi-threading optimization

I wrote an http server for the management of scores for users and levels. It can returns the highest score per level. It has a simple login with session-key. What do you think could be improved in ...
1
vote
1answer
1k views

Multithreaded Client-Server file downloading application

A multithreaded client server program to download image files. If you want to execute it on your machine you should change the file paths. Since there are four files to download the client makes the ...
3
votes
1answer
57 views

Dining Philosophers problem Solution with Java Reentrant Lock

I have implemented Dining Philosopher problem using ReentrantLock in java. The goal of this program is Every philosopher should follow the workflow of think,getchopsticks,eat,putchopsticks (No ...
1
vote
1answer
49 views

Java - Is this the correct implementation of a timer/timertask to destroy a process that overruns a defined time limit

I was wondering if this is the correct implementation of a times task to destroy a thread after it overruns a predefined time period: it works by creating a getting the thread from ...
3
votes
2answers
55 views

Moving from normal threads to ExecutorService thread pools in java

I had my original threading code which worked well, but since my tasks were shortlived, I decided to use thread pools through ExecutorService. This was my original code public class MyRun implements ...
1
vote
1answer
50 views

Log and Count the exception in a Single method

I am tring to count the number of exceptions happening and log those exceptions as well. So what I did is, I created one method addException in which I am counting all the exceptions. addException ...
2
votes
1answer
96 views

Review of simple Java Actor library

How can I improve this code? Also available from git://github.com/edescourtis/actor.git . Actor.java package com.benbria.actor; public interface Actor<T> extends Runnable { public ...
1
vote
1answer
30 views

Ensuring my program is thread safe

I have a class which is responsible for waiting until a message is added to a message list and then sending it off to get processed withdrawMessages - waits for message. I wait a total of 2 minutes ...
1
vote
0answers
32 views

Communication with GARMIN throught WEB (Java Socket Programming Code Review)

I am developing a WEB based GPS system and one of its functionallity is to be able to send messages and routes to GARMIN devices. I have never been using sockets before and for some (obvious) reason ...
-1
votes
0answers
85 views

What is needed to bring the website down?

I am running windows 7 (32 OS),on intel core 2 duo processor and 4 GB RAM. For learning purposes I was trying a Spam attack on a local website with the code written in java. I started the application ...
3
votes
2answers
54 views

Is this a scenario to use volatile instead of synchronized?

I want to know if using volatile in this scenario will give a better performance than using synchronization. Specifically for the paused and running instance variable in the SimulationManager class. ...
0
votes
1answer
58 views

Java concurrent Map of List

I need concurrent HashMap of List as value with following behavior: count of read/write ops approximately equals support add/remove values in lists thread safe iterations over lists After some ...
3
votes
1answer
107 views

Multi threaded circular buffer

I should write a circular buffer with multithread write and single read ability. Here is my solution: public class RingBuffer<E> extends AbstractList<E> implements RandomAccess { ...
1
vote
1answer
151 views

How to update my Swing JTable dynamically. MVC Pattern

I have created a program using a version of MVC architecture. The purpose of the code is to scrape the h1 titles of a list of webpages and to return the results to a JTable. So far I have the ...
3
votes
4answers
559 views

Optimizing a thread safe Java NIO / Serialization / FIFO Queue

I've written a thread safe, persistent FIFO for Serializable items. The reason for reinventing the wheel is that we simply can't afford any third party dependencies in this project and want to keep ...

1 2 3 4
15 30 50 per page