Home » Tag Archives: Concurrency (page 10)

Tag Archives: Concurrency

Java Executor Service Types

java-logo

ExecutorService feature was come with Java 5. It extends Executor interface and provides thread pool feature to execute asynchronous short tasks. There are five ways to execute the tasks asyncronously by using ExecutorService interface provided Java 6. ExecutorService execService = Executors.newCachedThreadPool(); This method of the approach creates a thread pool that creates new threads as needed, but will reuse previously ...

Read More »

Java Concurrency – CyclicBarrier Example

java-logo

CyclicBarrier in Java is a synchronizer introduced in JDK 5 on java.util.Concurrent package along with other concurrent utility like Counting Semaphore, BlockingQueue, ConcurrentHashMap etc. CyclicBarrier is similar to CountDownLatch which we have seen in last article and allows multiple threads to wait for each other (barrier) before proceeding. Also difference between CoundDownLatch and CyclicBarrier is a also very popular multi-threading ...

Read More »

Native vs Green threads

software-development-2-logo

Native vs Green threads  Understanding a multi-threaded program have always been a wild goose chase for many programmers. There are always many aspects to consider when writing a multi-threaded program. Green threads vs Native Threads The difference between green threads vs native threads is something that programmers may be unaware of. Both are mechanisms are ways of achieving a ‘multi-threaded ...

Read More »

Concurrency – Sequential and Raw Thread

java-logo

I worked on a project a while back, where the report flow was along these lines: User would request for a report The report request would be translated into smaller parts/sections The report for each part, based on the type of the part/section would be generated by a report generator The constituent report parts would be reassembled into a final ...

Read More »

Concurrency – Executors and Spring Integration

spring-interview-questions-answers

Thread Pool/Executors Based Implementation A better approach than the raw thread version, is a Thread pool based one, where an appropriate thread pool size is defined based on the system where the task is running – Number of CPU’s/(1-Blocking Coefficient of Task). Venkat Subramaniams book has more details: First I defined a custom task to generate the Report Part, given ...

Read More »

Java concurrency – Feedback from tasks

java-logo

Picking up from where I left off in my last post about the java.util.concurrent package, it’s interesting and sometimes mandatory to get feedback from concurrent tasks after they are started. For example imagine an application that has to send email batches, besides from using a multi-threaded mechanism, you want to know how many of the intended emails were successfully dispatched, ...

Read More »

Java Thread deadlock – Case Study

java-logo

This article will describe the complete root cause analysis of a recent Java deadlock problem observed from a Weblogic 11g production system running on the IBM JVM 1.6. This case study will also demonstrate the importance of mastering Thread Dump analysis skills; including for the IBM JVM Thread Dump format. Environment specifications – Java EE server: Oracle Weblogic Server 11g ...

Read More »

Latency, Throughput and Degree of Concurrency

software-development-2-logo

chrisapotek asked. How do you define throughput and latency for your test? There is not a simple question, so I have replied with a post. Sustained Throughput I consider throughput to be the number of actions a process can perform over a sustained period of time, between 10 seconds and day. (Assuming you have a quite period over night to ...

Read More »

Threading stories: ThreadLocal in web applications

java-logo

This week I spend reasonable time to eliminate all our ThreadLocal variables in our web applications. The reason was that they created classloader leaks and we coudn’t undeploy our applications properly anymore. Classloader leaks happen when a GC root keeps referencing an application object after the application was undeployed. If an application object is still referenced after undeploy, then the ...

Read More »

Java Concurrency with ReadWriteLock

java-logo

Writing multithreaded java applications is not a piece of cake. Extra care must be taken because bad synchronization can bring your application to its knees. The JVM heap is shared by all the threads. If multiple threads need to use the same objects or static class variables concurrently, thread access to shared data must be carefuly managed. Since version 1.5, ...

Read More »
Want to take your Java Skills to the next level?
Grab our programming books for FREE!
  • Save time by leveraging our field-tested solutions to common problems.
  • The books cover a wide range of topics, from JPA and JUnit, to JMeter and Android.
  • Each book comes as a standalone guide (with source code provided), so that you use it as reference.
Last Step ...

Where should we send the free eBooks?

Good Work!
To download the books, please verify your email address by following the instructions found on the email we just sent you.