SlideShare une entreprise Scribd logo
1  sur  24
Télécharger pour lire hors ligne
Javolution
Real-Time System Design project,
Stoenescu Serban
"The ability to simplify means to eliminate the
unnecessary so that the necessary may speak."
Hans Hoffmann
What is Javolution?
● Javolution is a Java API for real-time software
systems
● Real-time systems imply:
● Higher execution speed
● Time predictability
Advantages
● Some classes are easier to use than standard
classes in some SDKs or APIs.
● Example: „You don't need to guess the capacity
of a TextBuilder, FastTable or a FastMap, their
size expand gently without ever incurring
expensive resize/copy or rehash operations
(unlike StringBuilder, ArrayList or HashMap).
„ [1]
Advantages (continued)
● Javolution makes it easy for concurrent
algorithms to take advantage of multi-
processors systems. [1]
● Example: Class ConcurrentContext
● When a thread enters a concurrent context, it
may call the execute method, then continue
with a concurrent thread immediately (or the
thread itself if there is no concurrent thread
immediately available)
Advantages (continued)
● Real-time collection classes
● Example: ArrayList (standard) vs. FastTable
(Javolution:
● ArrayList may throw
ConcurrentModificationException
● FastTable does not throw it (more thread-safe)
Advantages (continued)
● Provides Struct and Union classes for direct
interoperability with C/C++;
Advantages (continued)
● Most Javolution classes are stateless ([1])
● state passed through parameters to methods or
available through Context classes
● This design approach makes Javolution and
any product based on Javolution highly
parrallelizable with no need for synchronization
Important Features
● Context classes allow true separation of
concerns (eg. logging, performance, etc.)
● Testing framework
● Allows assertions on execution time in
nanoseconds
● World's fastest and first hard real-time XML
marshalling/unmarshalling facility([1])
Example Classes
Context
● This class represents an execution context;
they can be associated to particular threads or
objects.
● Applications may extend this to facilitate
separation of concerns
● Extended by:
● ConcurrentContext (see slide 5)
● SecurityContext
SecurityContext
● Used for separating security concerns.
Example for addressing security requirements
([1])
public static boolean isReadAllowed(Table table) {
SecurityContext policy = SecurityContext.current();
return (policy instanceof DatabaseAccess.Permission) ?
((DatabaseAccess.Permission)policy).isReadable(table) :
false;
}
High Performance IO Classes
● CharSequenceReader
● UTF8ByteBufferReader
● UTF8ByteBufferWriter
● UTF8StreamReader
● UTF8StreamWriter
● Differences between this and standard
StreamWriters:
– Instances of this class can be reused for different output
streams.
– Wrapping using a java.io.BufferedWriter is unnescessary
as instances of this class embed their own data buffers.
The Realtime Package
● RealTimeInterface: defines RTSJ safe classes
● RealtimeThread: time-predictable threads
● Reflection.Constructor and Reflection.Method:
● Achieves some of the features provided by
reflection
● Reflection is known to be slow
The javolution.util Package
● Includes a lot of Javolution collection classes
that have counterparts in standard Java
packages.
● Examples:
– FastMap<K,V> - HashMap<K,V>
– FastSet<E> - Set<E>
– FastTable<E> - ArrayList<E>
The javolution.util Package
(continued)
● StandardLog class: represents a specialized
logging context forwarding events to a standard
logger (java.util.logging.Logger) ([1])
● ReentrantLock: same functionality as standard
locks
More features
● javolution.xml and subpackages provide fast
XML processing features
Sample Application
Sample application
● Application is similar reaction time tests in
driving schools
● Used for testing and improving reaction times
● User is shown some letters
● He is supposed to press a key as fast as he can
if a vocal appears, before it disappears
● Otherwise he is not supposed to press anything
Sample application (continued)
● Uses RealtimeThread for controlling the output
and measuring reaction times
● Also measures delays caused by threads
● Uses FastSet to keep records of events
Reaction Time Measurement
Log and Statistics
Thread delays measurement
(milliseconds)
References
● [1] „Javolution” - http://javolution.org/

Contenu connexe

Tendances

Operating Systems 1 (8/12) - Concurrency
Operating Systems 1 (8/12) - ConcurrencyOperating Systems 1 (8/12) - Concurrency
Operating Systems 1 (8/12) - Concurrency
Peter Tröger
 
Inter threadcommunication.38
Inter threadcommunication.38Inter threadcommunication.38
Inter threadcommunication.38
myrajendra
 

Tendances (20)

Java memory model
Java memory modelJava memory model
Java memory model
 
Threads in JAVA
Threads in JAVAThreads in JAVA
Threads in JAVA
 
Java Memory Model
Java Memory ModelJava Memory Model
Java Memory Model
 
Learning Java 3 – Threads and Synchronization
Learning Java 3 – Threads and SynchronizationLearning Java 3 – Threads and Synchronization
Learning Java 3 – Threads and Synchronization
 
Java threads
Java threadsJava threads
Java threads
 
Threads in Java
Threads in JavaThreads in Java
Threads in Java
 
SFScon14: Schrödinger’s elephant: why PostgreSQL can solve all your database ...
SFScon14: Schrödinger’s elephant: why PostgreSQL can solve all your database ...SFScon14: Schrödinger’s elephant: why PostgreSQL can solve all your database ...
SFScon14: Schrödinger’s elephant: why PostgreSQL can solve all your database ...
 
Java Threads: Lightweight Processes
Java Threads: Lightweight ProcessesJava Threads: Lightweight Processes
Java Threads: Lightweight Processes
 
Threading in java - a pragmatic primer
Threading in java - a pragmatic primerThreading in java - a pragmatic primer
Threading in java - a pragmatic primer
 
Operating system NachOS
Operating system NachOSOperating system NachOS
Operating system NachOS
 
Operating Systems 1 (8/12) - Concurrency
Operating Systems 1 (8/12) - ConcurrencyOperating Systems 1 (8/12) - Concurrency
Operating Systems 1 (8/12) - Concurrency
 
Load testing in Zonky with Gatling
Load testing in Zonky with GatlingLoad testing in Zonky with Gatling
Load testing in Zonky with Gatling
 
Java 8 new features
Java 8 new features Java 8 new features
Java 8 new features
 
javathreads
javathreadsjavathreads
javathreads
 
Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in java
 
Inter thread communication &amp; runnable interface
Inter thread communication &amp; runnable interfaceInter thread communication &amp; runnable interface
Inter thread communication &amp; runnable interface
 
Advanced Introduction to Java Multi-Threading - Full (chok)
Advanced Introduction to Java Multi-Threading - Full (chok)Advanced Introduction to Java Multi-Threading - Full (chok)
Advanced Introduction to Java Multi-Threading - Full (chok)
 
Inter threadcommunication.38
Inter threadcommunication.38Inter threadcommunication.38
Inter threadcommunication.38
 
Multithreading Presentation
Multithreading PresentationMultithreading Presentation
Multithreading Presentation
 
Java Thread & Multithreading
Java Thread & MultithreadingJava Thread & Multithreading
Java Thread & Multithreading
 

Similaire à Javolution rtsd

Similaire à Javolution rtsd (20)

Hibernate 1x2
Hibernate 1x2Hibernate 1x2
Hibernate 1x2
 
Performance Tuning - Memory leaks, Thread deadlocks, JDK tools
Performance Tuning -  Memory leaks, Thread deadlocks, JDK toolsPerformance Tuning -  Memory leaks, Thread deadlocks, JDK tools
Performance Tuning - Memory leaks, Thread deadlocks, JDK tools
 
Java Enterprise Edition
Java Enterprise EditionJava Enterprise Edition
Java Enterprise Edition
 
What is Java Technology (An introduction with comparision of .net coding)
What is Java Technology (An introduction with comparision of .net coding)What is Java Technology (An introduction with comparision of .net coding)
What is Java Technology (An introduction with comparision of .net coding)
 
The Java Memory Model
The Java Memory ModelThe Java Memory Model
The Java Memory Model
 
Java programing considering performance
Java programing considering performanceJava programing considering performance
Java programing considering performance
 
Multithreading and concurrency in android
Multithreading and concurrency in androidMultithreading and concurrency in android
Multithreading and concurrency in android
 
Best practices in Java
Best practices in JavaBest practices in Java
Best practices in Java
 
Basics of Java Concurrency
Basics of Java ConcurrencyBasics of Java Concurrency
Basics of Java Concurrency
 
Annotations
AnnotationsAnnotations
Annotations
 
Modern Java Concurrency
Modern Java ConcurrencyModern Java Concurrency
Modern Java Concurrency
 
Java concurrency
Java concurrencyJava concurrency
Java concurrency
 
Chap7 slides
Chap7 slidesChap7 slides
Chap7 slides
 
Core Java Programming Language (JSE) : Chapter X - I/O Fundamentals
Core Java Programming Language (JSE) : Chapter X - I/O Fundamentals Core Java Programming Language (JSE) : Chapter X - I/O Fundamentals
Core Java Programming Language (JSE) : Chapter X - I/O Fundamentals
 
Java Multithreading and Concurrency
Java Multithreading and ConcurrencyJava Multithreading and Concurrency
Java Multithreading and Concurrency
 
Java Memory Model
Java Memory ModelJava Memory Model
Java Memory Model
 
20160609 nike techtalks reactive applications tools of the trade
20160609 nike techtalks reactive applications   tools of the trade20160609 nike techtalks reactive applications   tools of the trade
20160609 nike techtalks reactive applications tools of the trade
 
Java For beginners and CSIT and IT students
Java  For beginners and CSIT and IT studentsJava  For beginners and CSIT and IT students
Java For beginners and CSIT and IT students
 
[Paper reading] Interleaving with Coroutines: A Practical Approach for Robust...
[Paper reading] Interleaving with Coroutines: A Practical Approach for Robust...[Paper reading] Interleaving with Coroutines: A Practical Approach for Robust...
[Paper reading] Interleaving with Coroutines: A Practical Approach for Robust...
 
Comparison between zookeeper, etcd 3 and other distributed coordination systems
Comparison between zookeeper, etcd 3 and other distributed coordination systemsComparison between zookeeper, etcd 3 and other distributed coordination systems
Comparison between zookeeper, etcd 3 and other distributed coordination systems
 

Plus de Serban Stoenescu (9)

Towards the impact of design flaws on resources used by an application
Towards the impact of design flaws on resources used by an application Towards the impact of design flaws on resources used by an application
Towards the impact of design flaws on resources used by an application
 
ReAjax report
ReAjax reportReAjax report
ReAjax report
 
ReAjax Presentation
ReAjax PresentationReAjax Presentation
ReAjax Presentation
 
Anunt inchiriere apartament_soarelui
Anunt inchiriere apartament_soareluiAnunt inchiriere apartament_soarelui
Anunt inchiriere apartament_soarelui
 
Sisteme expert mps2
Sisteme expert mps2Sisteme expert mps2
Sisteme expert mps2
 
Sisteme expert mps
Sisteme expert mpsSisteme expert mps
Sisteme expert mps
 
Standing on principle
Standing on principleStanding on principle
Standing on principle
 
Standing on principle
Standing on principleStanding on principle
Standing on principle
 
100 NASA rules for project management
100 NASA rules for project management100 NASA rules for project management
100 NASA rules for project management
 

Dernier

Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
MateoGardella
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 

Dernier (20)

Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 

Javolution rtsd

  • 1. Javolution Real-Time System Design project, Stoenescu Serban
  • 2. "The ability to simplify means to eliminate the unnecessary so that the necessary may speak." Hans Hoffmann
  • 3. What is Javolution? ● Javolution is a Java API for real-time software systems ● Real-time systems imply: ● Higher execution speed ● Time predictability
  • 4. Advantages ● Some classes are easier to use than standard classes in some SDKs or APIs. ● Example: „You don't need to guess the capacity of a TextBuilder, FastTable or a FastMap, their size expand gently without ever incurring expensive resize/copy or rehash operations (unlike StringBuilder, ArrayList or HashMap). „ [1]
  • 5. Advantages (continued) ● Javolution makes it easy for concurrent algorithms to take advantage of multi- processors systems. [1] ● Example: Class ConcurrentContext ● When a thread enters a concurrent context, it may call the execute method, then continue with a concurrent thread immediately (or the thread itself if there is no concurrent thread immediately available)
  • 6. Advantages (continued) ● Real-time collection classes ● Example: ArrayList (standard) vs. FastTable (Javolution: ● ArrayList may throw ConcurrentModificationException ● FastTable does not throw it (more thread-safe)
  • 7. Advantages (continued) ● Provides Struct and Union classes for direct interoperability with C/C++;
  • 8. Advantages (continued) ● Most Javolution classes are stateless ([1]) ● state passed through parameters to methods or available through Context classes ● This design approach makes Javolution and any product based on Javolution highly parrallelizable with no need for synchronization
  • 9. Important Features ● Context classes allow true separation of concerns (eg. logging, performance, etc.) ● Testing framework ● Allows assertions on execution time in nanoseconds ● World's fastest and first hard real-time XML marshalling/unmarshalling facility([1])
  • 11. Context ● This class represents an execution context; they can be associated to particular threads or objects. ● Applications may extend this to facilitate separation of concerns ● Extended by: ● ConcurrentContext (see slide 5) ● SecurityContext
  • 12. SecurityContext ● Used for separating security concerns. Example for addressing security requirements ([1]) public static boolean isReadAllowed(Table table) { SecurityContext policy = SecurityContext.current(); return (policy instanceof DatabaseAccess.Permission) ? ((DatabaseAccess.Permission)policy).isReadable(table) : false; }
  • 13. High Performance IO Classes ● CharSequenceReader ● UTF8ByteBufferReader ● UTF8ByteBufferWriter ● UTF8StreamReader ● UTF8StreamWriter ● Differences between this and standard StreamWriters: – Instances of this class can be reused for different output streams. – Wrapping using a java.io.BufferedWriter is unnescessary as instances of this class embed their own data buffers.
  • 14. The Realtime Package ● RealTimeInterface: defines RTSJ safe classes ● RealtimeThread: time-predictable threads ● Reflection.Constructor and Reflection.Method: ● Achieves some of the features provided by reflection ● Reflection is known to be slow
  • 15. The javolution.util Package ● Includes a lot of Javolution collection classes that have counterparts in standard Java packages. ● Examples: – FastMap<K,V> - HashMap<K,V> – FastSet<E> - Set<E> – FastTable<E> - ArrayList<E>
  • 16. The javolution.util Package (continued) ● StandardLog class: represents a specialized logging context forwarding events to a standard logger (java.util.logging.Logger) ([1]) ● ReentrantLock: same functionality as standard locks
  • 17. More features ● javolution.xml and subpackages provide fast XML processing features
  • 19. Sample application ● Application is similar reaction time tests in driving schools ● Used for testing and improving reaction times ● User is shown some letters ● He is supposed to press a key as fast as he can if a vocal appears, before it disappears ● Otherwise he is not supposed to press anything
  • 20. Sample application (continued) ● Uses RealtimeThread for controlling the output and measuring reaction times ● Also measures delays caused by threads ● Uses FastSet to keep records of events
  • 24. References ● [1] „Javolution” - http://javolution.org/