Skip to main content

All Questions

2votes
2answers
520views

Write deduplicated 9-digit numbers from concurrent clients to a log

Problem Statement: Write a server (“Application”) in Java that opens a socket and restricts input to at most 5 concurrent clients. Clients will connect to the Application and write any number of 9 ...
1vote
1answer
1kviews

Concurrent Queue with enqueue and dequeue using Stack as underlying data structure

This is a mix of data structure and multi threading concept based question. (This is only for understanding and learning purpose) The language for the solution : Java A Queue with FIFO behavior needs ...
1vote
1answer
3kviews

Thread Safe Evicting Queue in Java

Just wrote an Evicting Queue implementation, as an ordinary Linked List working under the hood, in Java; which, I hope, I've made thread safe, could you review? Code: ...
2votes
0answers
276views

Throttle submissions to ExecutorService

To prevent an XY problem, I'll first explain the problem I am trying to solve: Problem I am trying to solve I want to send the contents of a MongoDB collection with a size of around 3 million ...
5votes
1answer
2kviews

Message Queue for inter-thread communication

I wrote this little piece of code, a while back. The intention behind it was to create a system to send messages between consumer and producer threads. I have no idea for what i wanted to use it. I ...
1vote
1answer
932views

Job queue with threading

On many articles and blogs, I have read that exceptions should not decide flow of your code. I have wrote the following code using one thread: ...
7votes
2answers
1kviews

MailQueue implementation with auto start - stop

Previous question was a little portion of the mailQueue. I finished the MailQueue, which has the ability to start and stop ...
-2votes
2answers
686views

Simple Implementation of a BlockingQueue

An implementation of BlockingQueue ...
2votes
5answers
2kviews

Bounded blocking queue

Can someone please review this code for me? I have not implemented all the methods for simplicity. ...
5votes
1answer
144views

MailQueue - follow up

Follow up of this question. Things altered: Put logging (debug level) for creating and starting thread. A separate thread for starting the different threads. Locking object and synchronise for ...
5votes
5answers
21kviews

Circular queue implementation

I've implemented a simple thread-safe circular queue. I'm looking for code review, optimizations and best practices. ...
4votes
2answers
2kviews

Using a Java queue

I am developing a plugin for a system, the plugin catches some events in that system, wraps them and pushes out to another system for analysis. The overhead generated by the plugin must be as low as ...
15votes
5answers
17kviews

Java blocking queue

...
3votes
3answers
109views

Threadsafe get method on queue that draws values from other queues?

I have a class that implements Queue and draws values from other queues which may still be referenced outwith it. I want my method to draw values from the contained queues, using synchronized locks on ...
4votes
2answers
5kviews

Robust logging solution to file on disk from multiple threads on serverside code

I have implemented a socket listener that runs on my Linux Ubuntu server accepting connections and then starting up a new thread to listen on those connections (classic socket listener approach). ...

153050per page
close