At first glance, writing concurrent programs in Java seems like a straight-forward task. But the devil is in the detail. Fortunately, these details are strictly regulated by the Java memory model which, roughly speaking, decides what values a program can observe for a field at any given time. Without respecting the memory model, a Java program might behave erratic and yield bugs that only occure on some hardware platforms. This presentation summarizes the guarantees that are given by Java's memory model and teaches how to properly use volatile and final fields or synchronized code blocks. Instead of discussing the model in terms of memory model formalisms, this presentation builds on easy-to follow Java code examples.
The Java Memory Model describes how threads in the Java programming language interact through memory. Together with the description of single-threaded execution of code, the memory model provides the semantics of the Java programming language.
It is crucial for a programmer to know how, according to Java Language Specification, write correctly synchronized, race free programs.
At first glance, writing concurrent programs in Java seems like a straight-forward task. But the devil is in the detail. Fortunately, these details are strictly regulated by the Java memory model which, roughly speaking, decides what values a program can observe for a field at any given time. Without respecting the memory model, a Java program might behave erratic and yield bugs that only occure on some hardware platforms. This presentation summarizes the guarantees that are given by Java's memory model and teaches how to properly use volatile and final fields or synchronized code blocks. Instead of discussing the model in terms of memory model formalisms, this presentation builds on easy-to follow Java code examples.
The Java Memory Model describes how threads in the Java programming language interact through memory. Together with the description of single-threaded execution of code, the memory model provides the semantics of the Java programming language.
It is crucial for a programmer to know how, according to Java Language Specification, write correctly synchronized, race free programs.
Java has a solid Memory Model, and there are a couple of excellent libraries for concurrency. When you start working with threads however, pitfalls start appearing - especially if the program is supposed to be fast and correct. This session shows proven solutions for some typical problems, showing how to view program code from a concurrency perspective: Which threads share which data, and how? How to reduce the impact of locks? How to avoid them altogether - and when is that worth it?
Just recently I've checked the VirtualDub project with PVS-Studio. This was a random choice. You see, I believe that it is very important to regularly check and re-check various projects to show users that the PVS-Studio analyzer is evolving, and which project you run it on doesn't matter that much - bugs can be found everywhere. We already checked the VirtualDub project in 2011, but we found almost nothing of interest then. So, I decided to take a look at it now, 2 years later.
Multithreaded fundamentals
The thread class and runnable interface
Creating a thread
Creating multiple threads
Determining when a thread ends
Thread priorities
Synchronization
Using synchronized methods
The synchronized statement
Thread communication using notify(), wait() and notifyall()
Suspending , resuming and stopping threads
Threads are lightweight processes as the overhead of switching between threads is less
Synchronization allows only one thread to perform an operation on a object at a time.
Synchronization prevent data corruption
Thread Synchronization-The synchronized methods define critical sections.
You will learn the Deadlock Condition in Threads and Syncronization of Threads
JAVA CERTIFICATION EXAM OBJECTIVES
COVERED IN THIS CHAPTER:
4.1 Write code to define, instantiate, and start new threads
using both java.lang.Thread and java.lang.Runnable.
4.2 Recognize the states in which a thread can exist, and
identify ways in which a thread can transition from one state
to another.
4.3 Given a scenario, write code that makes appropriate use
of object locking to protect static or instance variables from
concurrent access problems.
4.4 Given a scenario, write code that makes appropriate use of wait, notify, or notifyAll.
This session was presented at the JFall 2011 conference in The Netherlands. It introduces the Fork/Join framework that was introduced in Java 7. Example code can be found at http://bit.y/jfall-forkjoin
There is a recipe for stressing a server and visualising the GC graphs with different configurations. This was done as a demo during a talk given on CorkJUG on 20/jan/16.
The Content Arms Race: Why Brands Are ScrewedAndrew Grinaker
Coca-Cola isn’t competing with Pepsi. Microsoft isn’t competing with Apple. They are competing with the infinite content choices provided by publishers and content creators today. This competition is pushing brand messages and their content further down the social timeline, deeming brand content less relevant and less impactful.
This session will outline the uphill battle that brands face to win the attention and loyalty of their audiences. We will dissect the brands that are winning the content arms race in their space. And lastly, provide a strategic framework for how brands can create, publish and measure their content more successfully.
Java has a solid Memory Model, and there are a couple of excellent libraries for concurrency. When you start working with threads however, pitfalls start appearing - especially if the program is supposed to be fast and correct. This session shows proven solutions for some typical problems, showing how to view program code from a concurrency perspective: Which threads share which data, and how? How to reduce the impact of locks? How to avoid them altogether - and when is that worth it?
Just recently I've checked the VirtualDub project with PVS-Studio. This was a random choice. You see, I believe that it is very important to regularly check and re-check various projects to show users that the PVS-Studio analyzer is evolving, and which project you run it on doesn't matter that much - bugs can be found everywhere. We already checked the VirtualDub project in 2011, but we found almost nothing of interest then. So, I decided to take a look at it now, 2 years later.
Multithreaded fundamentals
The thread class and runnable interface
Creating a thread
Creating multiple threads
Determining when a thread ends
Thread priorities
Synchronization
Using synchronized methods
The synchronized statement
Thread communication using notify(), wait() and notifyall()
Suspending , resuming and stopping threads
Threads are lightweight processes as the overhead of switching between threads is less
Synchronization allows only one thread to perform an operation on a object at a time.
Synchronization prevent data corruption
Thread Synchronization-The synchronized methods define critical sections.
You will learn the Deadlock Condition in Threads and Syncronization of Threads
JAVA CERTIFICATION EXAM OBJECTIVES
COVERED IN THIS CHAPTER:
4.1 Write code to define, instantiate, and start new threads
using both java.lang.Thread and java.lang.Runnable.
4.2 Recognize the states in which a thread can exist, and
identify ways in which a thread can transition from one state
to another.
4.3 Given a scenario, write code that makes appropriate use
of object locking to protect static or instance variables from
concurrent access problems.
4.4 Given a scenario, write code that makes appropriate use of wait, notify, or notifyAll.
This session was presented at the JFall 2011 conference in The Netherlands. It introduces the Fork/Join framework that was introduced in Java 7. Example code can be found at http://bit.y/jfall-forkjoin
There is a recipe for stressing a server and visualising the GC graphs with different configurations. This was done as a demo during a talk given on CorkJUG on 20/jan/16.
The Content Arms Race: Why Brands Are ScrewedAndrew Grinaker
Coca-Cola isn’t competing with Pepsi. Microsoft isn’t competing with Apple. They are competing with the infinite content choices provided by publishers and content creators today. This competition is pushing brand messages and their content further down the social timeline, deeming brand content less relevant and less impactful.
This session will outline the uphill battle that brands face to win the attention and loyalty of their audiences. We will dissect the brands that are winning the content arms race in their space. And lastly, provide a strategic framework for how brands can create, publish and measure their content more successfully.
English version of the presentation we gave at Devoxx FR 2012.
In depth analysis on how java Garbage collector works and how to minimise pause in your application.
Java Memory Consistency Model - concepts and contextTomek Borek
Java Memory Consistency Model is a difficult topic.
It's useful in making sure that multi-threaded programs on multi-threaded cores will interact with each other (and through memory) in a consistent manner.
It's specification is damn hard (even according to folks with lots of concurrent experience, like Doug Lea) to read, understand and routinely follow without error.
This presentation talks about some fallacies surrounding memory model, explains it, offers definitions and reasons for it's existence. It ain't deep, it's more entry level stuff.
This slide will explain about building blocks of JVM optimization for you java based application.
It explains basics of heap concepts and different type of java garbage collectors.
This presentation is primarily based on Oracle's "Java SE 6 HotSpot™ Virtual Machine Garbage Collection Tuning" document.
This introduces how Java manages memory using generations, available garbage collectors and how to tune them to achieve desired performance.
The workshop is based on several Nikita Salnikov-Tarnovski lectures + my own research. The workshop consists of 2 parts. The first part covers:
- different Java GCs, their main features, advantages and disadvantages;
- principles of GC tuning;
- work with GC Viewer as tool for GC analysis;
- first steps tuning demo;
- comparison primary GCs on Java 1.7 and Java 1.8
The second part covers:
- work with Off-Heap: ByteBuffer / Direct ByteBuffer / Unsafe / MapDB;
- examples and comparison of approaches;
The off-heap-demo: https://github.com/moisieienko-valerii/off-heap-demo
Nowadays people usually talk more about big data, internet of things, and other buzzwords on various conferences. However, sometimes developers tend to not pay enough attention to the core things such as garbage collection. After having a short discussion with many somewhat experienced Java developers I came to a conclusion that most of them do not know how many garbage collectors there are in the latest JVM, and under what circumstances each of them should be enabled. This presentation is aimed to improve or refresh people’s knowledge on this core topic, and share a real use case when it helped us to resolve production issue.
Concurrency on the JVM showing the nuts and bolts of Akka (I presume .. it's not first-hand stuff I'm saying, just speculating). Java Memory Model, Thread Pools, Actors and the likes of that will be covered.
Real World Lessons On The Anti-Patterns of Node.JSBen Hall
Talk delivered at London Node User Group on 22nd October 2014. Talk covers my personal pain points, issues I've encountered with Node and some suggested alternatives
It is mainly about the multithreading and the multiprocessing in Python, and *in Python's flavor*.
It's also the share at Taipei.py [1].
[1] http://www.meetup.com/Taipei-py/events/220452029/
From this session, you learn the consequences of Split Brain and what causes a Split Brain. and how to use a Split Brain Resolver to fix the Split Brain problem in an automated fashion. So stay tuned
Puppet Camp Berlin 2015: Felix Frank | Rapid Testing Setups for PuppetNETWAYS
Puppet installations are usually quite robust and require low maintenance. The initial setup is not quite trivial, however. The Puppet master will also become quite a critical system once it is put to work in earnest.
As a result, it can become a somewhat daunting task to perform changes on the master, or conduct more intrusive debugging. This presentation shows how test instances of both the master and agent can be launched with little effort, and how Puppet can be run from source.
This session discusses about the basic building blocks of Concurrent Programming in Java, which include:
high-level concurrency objects, lock objects, executors, executor interfaces, thread pools, fork/join, concurrent collections, atomic variables, concurrent random numbers.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
Generating a custom Ruby SDK for your web service or Rails API using Smithyg2nightmarescribd
Have you ever wanted a Ruby client API to communicate with your web service? Smithy is a protocol-agnostic language for defining services and SDKs. Smithy Ruby is an implementation of Smithy that generates a Ruby SDK using a Smithy model. In this talk, we will explore Smithy and Smithy Ruby to learn how to generate custom feature-rich SDKs that can communicate with any web service, such as a Rails JSON API.
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
Here is something new! In our next Connector Corner webinar, we will demonstrate how you can use a single workflow to:
Create a campaign using Mailchimp with merge tags/fields
Send an interactive Slack channel message (using buttons)
Have the message received by managers and peers along with a test email for review
But there’s more:
In a second workflow supporting the same use case, you’ll see:
Your campaign sent to target colleagues for approval
If the “Approve” button is clicked, a Jira/Zendesk ticket is created for the marketing design team
But—if the “Reject” button is pushed, colleagues will be alerted via Slack message
Join us to learn more about this new, human-in-the-loop capability, brought to you by Integration Service connectors.
And...
Speakers:
Akshay Agnihotri, Product Manager
Charlie Greenberg, Host
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
32. RACE CONDITION
▸ definition: shared resources may get used “at the same
time” by different threads, resulting in a invalid state.
▸ motivation: any need of concurrent or parallel processing.
▸ how to avoid: usage of some mechanism to ensure
resources are used by only one thread at a time or even
share nothing.
35. thread 1 thread 2
VAR=0
VAR++ VAR++
VAR=1
Clearly not the
expected result. There
are code in production
working with those
errors for years without
people realising it.
VAR WAS NOT
SYNCHRONISED PROPERLY
36. AVOIDING OR FIXING THIS RACE CONDITION
▸ let the database deal with it (just kidding, but sadly it seems to
be the standard way of doing it).
▸ correct synchronisation by using locks.
▸ usage of concurrent classes, such as AtomicLong.
▸ one counter per thread (summing them still requires
synchronisation).
▸ share nothing.
▸ any other suggestion?
40. thread 1 thread 2
VAR=0LOCK
VAR++
VAR++
VAR=2
The result was as
expected, but there
was a penalty in the
time it took to perform
both operations. In
order to minimise it
avoid sharing in the
first place.
VAR WAS
PROPERLY SYNCHRONISED
47. LESSONS
▸ Synchronise properly. High level APIs are easier not to
mess with. java.util.concurrent excels at that.
▸ The optimal number of threads is usually twice the number
of cores: Runtime.getRuntime().availableProcessors() * 2;
▸ Measure and stress. It is not easy to see synchronisation
issues, since the behaviour varies depending on machine,
operation system, etc. They usually don’t show while
debugging.
49. DEAD LOCKS
▸ what it is: threads holding and waiting each other locks.
▸ motivation: global lock leads to global contention and
slow code. Use of more than one fine grained lock at the
same time in more than one thread in a unpredictable way
is the real problem.
▸ how to avoid: ensure same locking order or review
synchronisation strategy (functional approach, atomic
classes, high level APIs, concurrent collections, share
nothing, etc).
50. thread 1 thread 2
AB
Two threads have
access to resources
protected by two
distinct locks: A and B.
Green means available,
yellow means waiting
and red means locked.
Two scenarios are
going to be presented:
Threads acquiring the
locks in the same order,
and in different order.
59. thread 1 thread 2
AB
Then lock A is released.
No synchronisation
problems has
happened and no
locked resources where
harmed in this
execution. Some
contention has
happened, but they
where temporary.
EVERYTHING WAS FINE.
62. thread 1 thread 2
A B
And the second thread
acquires lock B.
63. thread 1 thread 2
A B
B
The first thread tries to
acquire lock B. Since it
is busy, it will wait for it.
64. thread 1 thread 2
A B
B A
And the second thread
tries to acquire lock A.
Since it is busy, it will
wait for it.
65. thread 1 thread 2
A B
B A
What did the different
order of lock
acquisition cause?
Keep in mind locks can
be acquired internally
by APIs, by using the
synchronised keyword,
by doing IO. It is almost
impossible to keep
track of all the locks in
a huge application
stack.
DEAD LOCK IS SET.
66.
67.
68. LESSONS
▸ If sharing data between threads, synchronise properly and
measure and stress (same as before).
▸ Keep in mind some dead locks keeps latent and may happen
only in unusual situations (such as unusual high peak load).
▸ The best approach is to minimise sharing data, having
isolated threads working independently.
▸ There are frameworks that suits better than using threads
manually. Consider those, such as Akka, Disruptor, etc.
69. QUESTIONS? THANKS FOR YOUR TIME!
▸ https://www.cs.umd.edu/~pugh/java/memoryModel/
jsr-133-faq.html
▸ http://docs.oracle.com/javase/specs/
▸ fotos: Dani Teston