0
votes
3answers
435 views

Super Fast File Storage Engine

I basically have one big gigantic table (about 1.000.000.000.000 records) in a database with these fields: id, block_id, record id is unique, block_id is not unique, it contains about 10k (max) ...
0
votes
1answer
215 views

Apple Dispatch Queue vs Threads

I've heard a lot about apple's famous dispatch queues and the GCD but today was the first time I decided to understand exactly what is going on, so I started reading Concurrency Programming Guide and ...
6
votes
3answers
858 views

How many threads should access the file system at the same time?

We have a module in an application which stores data in multiple files and multilevel directories and access them from multiple threads (both reads and writes). The directory structure is based on a ...
0
votes
3answers
402 views

Multiple threads and single output source

For the sake of an exercise, say you have an input file with a series of lines of text with the objective of reversing their respective character sequences. Now introduce 5 threads that will each do ...
11
votes
2answers
3k views

Are these advanced/unfair interview questions regarding Java concurrency? [closed]

Here are some questions I've recently asked interviewees who say they know Java concurrency: Explain the hazard of "memory visibility" - the way the JVM can reorder certain operations on variables ...
4
votes
2answers
346 views

Help me understand a part of Java Language Specification

I'm reading part 17.2.1 of Java language specification: http://docs.oracle.com/javase/specs/jls/se7/html/jls-17.html#jls-17.2.1 I won't copy a text, it's too long, but I would like to know, why for ...
5
votes
3answers
694 views

how to verify ConcurrentHashMap is threadsafe?

As the jdk doc said, ConcurrentHashMap is thread safe and it doesn't block multiple thread read. It is not necessary to doubt that since it was under many and restricted test. But I just curious how ...
3
votes
2answers
126 views

Why should most logic be in the monitor objects and not in the thread objects when writing concurrent software in Java?

When I took the Realtime and Concurrent programming course our lecturer told us that when writing concurrent programs in Java and using monitors, most of the logic should be in the monitor and as ...
0
votes
2answers
735 views

How can we handle multiple instances of a method through a single class instance

How can we handle multiple instances of a method through a single class instance(Single constructor call)? To elaborate, I have a handler class which has two methods lets say verifyUser(String JSON) ...
7
votes
1answer
815 views

Conceptually what does it mean when it is said that each thread gets its own stack?

I have been reading Java Concurrency in Practice by Brian Goetz and inside the section Stack Confinement it is mentioned that each thread gets its own stack and so local variables are intrinsically ...
1
vote
1answer
590 views

Java BufferedReader vs Separate Producer consumer thread

I have a very big file delimited by some sequence of characters '*L*I*N*E'. The file will be of the order of 250G. And each line comes around 600bytes to 1000 bytes. I will be performing the following ...
8
votes
4answers
687 views

scalablity of Scala over Java

I read an article that says Scala handles concurrency better than Java. http://www.theserverside.com/feature/Solving-the-Scalability-Paradox-with-Scala-Clojure-and-Groovy ...the scalability ...
3
votes
1answer
207 views

Concurrency with listeners and upload: is this solution sound?

I'm working on an Android app. We have listeners for position data and camera capture which is timed on a background thread (not a service). The timer thread dictates when the image is captured ...
1
vote
1answer
540 views

Static objects and concurrency in a web application

I'm developing small Java Web Applications on Tomcat server and I'm using MySQL as my database. Up until now I was using a connection singleton for accessing the database but I found out that this ...
8
votes
5answers
4k views

Real world usage of DelayQueue

What would be a real world usage of DelayQueue, what common problem it was designed to solve?
3
votes
1answer
1k views

How to read from a database, and write to a file asynchronously / non blocking way in Java

I'm trying to modify a serial program that reads from a database, and writes results to a file, this is done in a blocking way and I think we can get performance boost of there is a memory buffer and ...
5
votes
3answers
650 views

How to avoid halting of the JVM due to a deadlock in java?

I have read many websites talking about how to avoid and how to design etc. I completely understand those strategies. My question is based on the following preconditions: You have a company with ...
6
votes
4answers
4k views

Problems of multiple threads sharing/accessing the same data [closed]

I have been researching into when data is being accessed or shared by multiple threads within Java. And looking into the problems such as: Thread Interference Memory Consistency Deadlock Starvation ...
2
votes
3answers
429 views

Sharing buffer between multiple threads part 2

This is a follow up to my previous not answered question, so I try to make it more clear: last question. I have a n-size buffer that is filled up from an external source, it has 2 main methods get() ...
11
votes
4answers
3k views

Why not Green Threads?

Whilst I know questions on this have been covered already (e.g. http://stackoverflow.com/questions/5713142/green-threads-vs-non-green-threads), I don't feel like I've got a satisfactory answer. The ...
3
votes
2answers
455 views

Are there any good Java/JVM libraries for my Expression Tree architecture?

My team and I are developing an enterprise-level application and I have devised an architecture for it that's best described as an "Expression Tree". The basic idea is that the leaf nodes of the tree ...
28
votes
5answers
7k views

Is object pooling a deprecated technique?

I am very familiar with the concept of object pooling and I always try to use it as much as possible. Additionally I always thought that object pooling is the standard norm as I have observed that ...
3
votes
4answers
555 views

Is the synchronized keyword,still used/needed in java?

Is the synchronised keyword still required (ignore backwards compatibility, I'm thinking in terms of writing new code, today) or should we all be using the features available in the Concurrent and ...