SlideShare a Scribd company logo
1 of 20
Download to read offline
Michael Sparks
BBC R&D, http://www.kamaelia.org/Home
Embracing
Concurrency
for Fun, Utility & Simpler Code
Ignite Leeds, Jan 2009
Michael Sparks
BBC R&D, http://www.kamaelia.org/Home
Embracing
Concurrency
for Fun, Utility & Simpler Code
Or “what we've learnt as a part of the
Kamaelia project about making concurrency
something that's fun and useful, and usable by
novice and advanced developers alike...
...rather than a pain in the neck”
Ignite Leeds, Jan 2009
Michael Sparks
BBC R&D, http://www.kamaelia.org/Home
Hardware finally going
massively concurrent ...
.... PS3, high end servers, trickling down to desktops, laptops)
Why?
“many hands make light
work” but Viewed as Hard
... do we just have crap tools?
“And one language to in
the darkness bind them”
... can just we REALLY abandon 50 years of code for Erlang, Haskell
and occam?
Opportunity!
Problems
Michael Sparks
BBC R&D, http://www.kamaelia.org/Home
We're Taught Wrong
Fundamental Control Structures
... in imperative languages number greater than 3!
Control Structure Traditional Abstraction Biggest Pain Points
Sequence Function Global Var
Selection Function Global Var
Iteration Function Global Var
Parallel Thread Shared Data
Usually Skipped Lost or duplicate update
are most common bugs
Michael Sparks
BBC R&D, http://www.kamaelia.org/Home
Desktop
APPS
Network
Novice
3rd
Party
Media
gsoc
trainee
Michael Sparks
BBC R&D, http://www.kamaelia.org/Home
Desktop
APPS
Network
Novice
3rd
Party
P2P Whiteboard
ER DB Modeller
Kids
Programming
(logo)
Simple
Games
Speak 'n Write
UGC
Backend
Transcoder
Think backend
needed for
youtube/flickr
type systems
Media
Compose
Shot Change
Detection
Mobile
Reframing
DVB
Macro
“record
everything”
Podcasts
Email &
SpamSMTP
Greylisting
Pop3Proxy ClientSide
Spam Tools
IRC
Web
Serving
gsoc
trainee
AIM
AWS
(Amazon)
Sedna
XMLDBXMPP
pubsub
Qt
Gtk
microblogging
MiniAxon
ScriptReader
MediaPreview
on Mobile
Reliable
Multicast
P2P Radio
Torrent
3D Systems
Realtime Music
Paint App
P2P Web Server
Secure “phone”
Social Net Vis
...
Michael Sparks
BBC R&D, http://www.kamaelia.org/Home
Core Approach:
Concurrent things with comms points
Generally send messages
Keep data private, don't share
inbox
control
...
outbox
signal
...
inbox
control
...
outbox
signal
...
Michael Sparks
BBC R&D, http://www.kamaelia.org/Home
But I must share data?
Use Software Transactional Memory
ie version control for variables.
1. Check out the collection
of values you wish to
work on
2. Change them
3. Check them back in
4. If conflict/clash, go
back to 1
Michael Sparks
BBC R&D, http://www.kamaelia.org/Home
Perspectives in APIs! (1/2)
1st
, 2nd
, 3rd
Person
inbox
control
...
outbox
signal
...
1st
Person - I change my state
2nd
Person – YOU
want to me to do
something
(you send
me a message)
3rd
Person –
Bla should
do something
(I send a message)
Michael Sparks
BBC R&D, http://www.kamaelia.org/Home
inbox
control
...
outbox
signal
...
private real methods
Messages
from public
inboxes
Messages sent
to public outboxes
Perspectives in APIs! (2/2)
1st
, 2nd
, 3rd
Person
Also, think
about stdin
Also, think
about stdout
Michael Sparks
BBC R&D, http://www.kamaelia.org/Home
inbox
control
...
private real methods
Messages
from public
inboxes
Actor Systems
Distinction can be unclear,
potential source of ambiguity*
No outbox concept
Possible issues with
rate limiting*
Hardcodes recipient
in the sender
*system dependent issue
Michael Sparks
BBC R&D, http://www.kamaelia.org/Home
Advantages of outboxes
inbox
control
...
outbox
signal
...
No hardcoding of recipient
allows:
- Late Binding
- Dynamic rewiring
Concurrency Patterns as
Reusable Code
... a concurrency DSL
Michael Sparks
BBC R&D, http://www.kamaelia.org/Home
A Core Concurrency DSL
Pipeline(A,B,C)
Graphline(A=A,B=B, C=C, linkages = {})
Tpipe(cond, C)
Seq(A,B,C), PAR(), ALT()
Backplane(“name”), PublishTo(“name”), SubscribeTo(“name”)
Carousel(...)
PureTransformer(...)
StatefulTransformer(...)
PureServer(...)
MessageDemuxer(...)
Source(*messages)
NullSink
Some of these are work in progress
– they've been identified as useful,
but not implemented as chassis, yet
Michael Sparks
BBC R&D, http://www.kamaelia.org/Home
Pipeline Example
Pipeline(
MyGamesEventsComponent(up="p", down="l", left="a", right="s"),
BasicSprite("cat.png", name = "cat", border=40),
).activate() MyGames
Events
Component
Basic
Sprite
Michael Sparks
BBC R&D, http://www.kamaelia.org/Home
Graphline Example
Graphline(
NEXT = Button(...),
PREVIOUS = Button(...),
FIRST = Button(...),
LAST = Button(...),
CHOOSER = Chooser(...),
IMAGE = Image(...),
...
).run()
FIRST
(button)
Chooser
LAST
(button)
PREVIOUS
(button)
NEXT
(button)
Image
Michael Sparks
BBC R&D, http://www.kamaelia.org/Home
Server Example
Main
Server Core
Remote
User
Protocol Handler Factory
Socket handler
Protocol handler
data
to
user
data
from
user
Created at runtime
to handle the
connection
Michael Sparks
BBC R&D, http://www.kamaelia.org/Home
Server Example
Main
Server Core
Protocol Handler Factory
You therefore
need to provide
this bit.
Michael Sparks
BBC R&D, http://www.kamaelia.org/Home
Server Example
from Kamaelia.Chassis.ConnectedServer import ServerCore
from Kamaelia.Util.PureTransformer import PureTransformer
def greeter(*argv, **argd):
return PureTransformer(lambda x: "hello" +x)
class GreeterServer(ServerCore):
protocol=greeter
port=1601
GreeterServer().run()
Michael Sparks
BBC R&D, http://www.kamaelia.org/Home
Backplane Example
# Streaming Server for raw DVB of Radio 1
Backplane(“Radio”).activate()
Pipeline(
DVB_Multiplex(850.16, [6210], feparams), # RADIO ONE
PublishTo("RADIO"),
).activate()
def radio(*argv,**argd):
return SubscribeTo(“RADIO”)
ServerCore(protocol=radio, port=1600).run()
Michael Sparks
BBC R&D, http://www.kamaelia.org/Home
Thank you for listening!
If you have questions, grab me later :-)

More Related Content

Similar to 4: Embracing Concurrency (Michael Sparks)

Embracing Concurrency: For Fun, Utility & Simpler Code (Michael Sparks)
Embracing Concurrency: For Fun, Utility & Simpler Code (Michael Sparks)Embracing Concurrency: For Fun, Utility & Simpler Code (Michael Sparks)
Embracing Concurrency: For Fun, Utility & Simpler Code (Michael Sparks)
LSx Festival of Technology
 
HIS 2015: Prof. Ian Phillips - Stronger than its weakest link
HIS 2015: Prof. Ian Phillips - Stronger than its weakest linkHIS 2015: Prof. Ian Phillips - Stronger than its weakest link
HIS 2015: Prof. Ian Phillips - Stronger than its weakest link
AdaCore
 
What’s New and Exciting in Library Makerspaces
What’s New and Exciting in Library MakerspacesWhat’s New and Exciting in Library Makerspaces
What’s New and Exciting in Library Makerspaces
St. Petersburg College
 

Similar to 4: Embracing Concurrency (Michael Sparks) (20)

Embracing Concurrency: For Fun, Utility & Simpler Code (Michael Sparks)
Embracing Concurrency: For Fun, Utility & Simpler Code (Michael Sparks)Embracing Concurrency: For Fun, Utility & Simpler Code (Michael Sparks)
Embracing Concurrency: For Fun, Utility & Simpler Code (Michael Sparks)
 
Kamaelia lightning2010opensource
Kamaelia lightning2010opensourceKamaelia lightning2010opensource
Kamaelia lightning2010opensource
 
Hacking OOo 2.0
Hacking OOo 2.0Hacking OOo 2.0
Hacking OOo 2.0
 
HIS 2015: Prof. Ian Phillips - Stronger than its weakest link
HIS 2015: Prof. Ian Phillips - Stronger than its weakest linkHIS 2015: Prof. Ian Phillips - Stronger than its weakest link
HIS 2015: Prof. Ian Phillips - Stronger than its weakest link
 
Timeshift Everything, Miss Nothing - Mashup your PVR with Kamaelia
Timeshift Everything, Miss Nothing - Mashup your PVR with KamaeliaTimeshift Everything, Miss Nothing - Mashup your PVR with Kamaelia
Timeshift Everything, Miss Nothing - Mashup your PVR with Kamaelia
 
small electronics for your makerspace 2 (clc trendspotting - 26 march 2014)
small electronics for your makerspace 2 (clc trendspotting - 26 march 2014)small electronics for your makerspace 2 (clc trendspotting - 26 march 2014)
small electronics for your makerspace 2 (clc trendspotting - 26 march 2014)
 
Embracing concurrency for fun utility and simpler code
Embracing concurrency for fun utility and simpler codeEmbracing concurrency for fun utility and simpler code
Embracing concurrency for fun utility and simpler code
 
Stronger than its Weakest Link
Stronger than its Weakest LinkStronger than its Weakest Link
Stronger than its Weakest Link
 
Exploring the Internet of Things Using Ruby
Exploring the Internet of Things Using RubyExploring the Internet of Things Using Ruby
Exploring the Internet of Things Using Ruby
 
Kernel Development: Drawing Lessons from "Mistakes" (Japan Linux Symposium 2009)
Kernel Development: Drawing Lessons from "Mistakes" (Japan Linux Symposium 2009)Kernel Development: Drawing Lessons from "Mistakes" (Japan Linux Symposium 2009)
Kernel Development: Drawing Lessons from "Mistakes" (Japan Linux Symposium 2009)
 
Raspberry-pi-report
Raspberry-pi-reportRaspberry-pi-report
Raspberry-pi-report
 
Ece raspberry-pi-report
Ece raspberry-pi-reportEce raspberry-pi-report
Ece raspberry-pi-report
 
How to Become a Hacker?
How to Become a Hacker?How to Become a Hacker?
How to Become a Hacker?
 
25 History Of The Internet
25 History Of The Internet25 History Of The Internet
25 History Of The Internet
 
Talk at the Landelijk Architecure Congress (NL)
Talk at the Landelijk Architecure Congress (NL)Talk at the Landelijk Architecure Congress (NL)
Talk at the Landelijk Architecure Congress (NL)
 
Free Software for Free Sound
Free Software for Free SoundFree Software for Free Sound
Free Software for Free Sound
 
Is Hardware the New Software? Creating the Hightech Innovations that will Tra...
Is Hardware the New Software? Creating the Hightech Innovations that will Tra...Is Hardware the New Software? Creating the Hightech Innovations that will Tra...
Is Hardware the New Software? Creating the Hightech Innovations that will Tra...
 
Free Software Movement and Open Source Communities
Free Software Movement and Open Source CommunitiesFree Software Movement and Open Source Communities
Free Software Movement and Open Source Communities
 
What’s New and Exciting in Library Makerspaces
What’s New and Exciting in Library MakerspacesWhat’s New and Exciting in Library Makerspaces
What’s New and Exciting in Library Makerspaces
 
Kamaelia Europython Tutorial
Kamaelia Europython TutorialKamaelia Europython Tutorial
Kamaelia Europython Tutorial
 

More from Imran Ali

Startup Fictions {1995-2010}
Startup Fictions {1995-2010}Startup Fictions {1995-2010}
Startup Fictions {1995-2010}
Imran Ali
 
Lessons Learned by The Difference Engine (Jon Bradford)
Lessons Learned by The Difference Engine (Jon Bradford)Lessons Learned by The Difference Engine (Jon Bradford)
Lessons Learned by The Difference Engine (Jon Bradford)
Imran Ali
 

More from Imran Ali (20)

Ownership of web content
Ownership of web contentOwnership of web content
Ownership of web content
 
Startup Fictions {1995-2010}
Startup Fictions {1995-2010}Startup Fictions {1995-2010}
Startup Fictions {1995-2010}
 
The New Federation (Julian Tait)
The New Federation (Julian Tait)The New Federation (Julian Tait)
The New Federation (Julian Tait)
 
Masquerade (Guy Dickinson)
Masquerade (Guy Dickinson)Masquerade (Guy Dickinson)
Masquerade (Guy Dickinson)
 
TBC (Dave Mee)
TBC (Dave Mee)TBC (Dave Mee)
TBC (Dave Mee)
 
Everything you know is wrong (Ivor Tymchak)
Everything you know is wrong (Ivor Tymchak)Everything you know is wrong (Ivor Tymchak)
Everything you know is wrong (Ivor Tymchak)
 
Design Truth (Matt Seward)
Design Truth (Matt Seward)Design Truth (Matt Seward)
Design Truth (Matt Seward)
 
Pst! The surreptitious beckoning of attention (Megan Smith)
Pst! The surreptitious beckoning of attention (Megan Smith)Pst! The surreptitious beckoning of attention (Megan Smith)
Pst! The surreptitious beckoning of attention (Megan Smith)
 
The Equality Act: Shouldn't 'geek' be a protected characteristic? (Tim Medcalf)
The Equality Act: Shouldn't 'geek' be a protected characteristic? (Tim Medcalf)The Equality Act: Shouldn't 'geek' be a protected characteristic? (Tim Medcalf)
The Equality Act: Shouldn't 'geek' be a protected characteristic? (Tim Medcalf)
 
How to get ahead in business the Boulton & Watt way (Matt Edgar)
 How to get ahead in business the Boulton & Watt way (Matt Edgar) How to get ahead in business the Boulton & Watt way (Matt Edgar)
How to get ahead in business the Boulton & Watt way (Matt Edgar)
 
Incompatible Couplings (Steve Manthorp)
Incompatible Couplings (Steve Manthorp)Incompatible Couplings (Steve Manthorp)
Incompatible Couplings (Steve Manthorp)
 
Lessons Learned by The Difference Engine (Jon Bradford)
Lessons Learned by The Difference Engine (Jon Bradford)Lessons Learned by The Difference Engine (Jon Bradford)
Lessons Learned by The Difference Engine (Jon Bradford)
 
Making things for real people (Dean Vipond)
Making things for real people (Dean Vipond)Making things for real people (Dean Vipond)
Making things for real people (Dean Vipond)
 
Prototyping a telephone service for the rest of humanity (Tim Panton)
Prototyping a telephone service for the rest of humanity (Tim Panton)Prototyping a telephone service for the rest of humanity (Tim Panton)
Prototyping a telephone service for the rest of humanity (Tim Panton)
 
Embracing Teleworking: Pros and Cons of the Virtual Office (Sam Foster)
Embracing Teleworking: Pros and Cons of the Virtual Office (Sam Foster)Embracing Teleworking: Pros and Cons of the Virtual Office (Sam Foster)
Embracing Teleworking: Pros and Cons of the Virtual Office (Sam Foster)
 
140 Characters to the Rescue (Herb Kim)
140 Characters to the Rescue (Herb Kim)140 Characters to the Rescue (Herb Kim)
140 Characters to the Rescue (Herb Kim)
 
Somethin bout nofin (Maz Hardey)
Somethin bout nofin (Maz Hardey)Somethin bout nofin (Maz Hardey)
Somethin bout nofin (Maz Hardey)
 
Digital Death & Virtual Suicide (Ben Dalton)
Digital Death & Virtual Suicide (Ben Dalton)Digital Death & Virtual Suicide (Ben Dalton)
Digital Death & Virtual Suicide (Ben Dalton)
 
Ignite Leeds - Introduction
Ignite Leeds - IntroductionIgnite Leeds - Introduction
Ignite Leeds - Introduction
 
Leeds 2.0
Leeds 2.0Leeds 2.0
Leeds 2.0
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 

4: Embracing Concurrency (Michael Sparks)

  • 1. Michael Sparks BBC R&D, http://www.kamaelia.org/Home Embracing Concurrency for Fun, Utility & Simpler Code Ignite Leeds, Jan 2009
  • 2. Michael Sparks BBC R&D, http://www.kamaelia.org/Home Embracing Concurrency for Fun, Utility & Simpler Code Or “what we've learnt as a part of the Kamaelia project about making concurrency something that's fun and useful, and usable by novice and advanced developers alike... ...rather than a pain in the neck” Ignite Leeds, Jan 2009
  • 3. Michael Sparks BBC R&D, http://www.kamaelia.org/Home Hardware finally going massively concurrent ... .... PS3, high end servers, trickling down to desktops, laptops) Why? “many hands make light work” but Viewed as Hard ... do we just have crap tools? “And one language to in the darkness bind them” ... can just we REALLY abandon 50 years of code for Erlang, Haskell and occam? Opportunity! Problems
  • 4. Michael Sparks BBC R&D, http://www.kamaelia.org/Home We're Taught Wrong Fundamental Control Structures ... in imperative languages number greater than 3! Control Structure Traditional Abstraction Biggest Pain Points Sequence Function Global Var Selection Function Global Var Iteration Function Global Var Parallel Thread Shared Data Usually Skipped Lost or duplicate update are most common bugs
  • 5. Michael Sparks BBC R&D, http://www.kamaelia.org/Home Desktop APPS Network Novice 3rd Party Media gsoc trainee
  • 6. Michael Sparks BBC R&D, http://www.kamaelia.org/Home Desktop APPS Network Novice 3rd Party P2P Whiteboard ER DB Modeller Kids Programming (logo) Simple Games Speak 'n Write UGC Backend Transcoder Think backend needed for youtube/flickr type systems Media Compose Shot Change Detection Mobile Reframing DVB Macro “record everything” Podcasts Email & SpamSMTP Greylisting Pop3Proxy ClientSide Spam Tools IRC Web Serving gsoc trainee AIM AWS (Amazon) Sedna XMLDBXMPP pubsub Qt Gtk microblogging MiniAxon ScriptReader MediaPreview on Mobile Reliable Multicast P2P Radio Torrent 3D Systems Realtime Music Paint App P2P Web Server Secure “phone” Social Net Vis ...
  • 7. Michael Sparks BBC R&D, http://www.kamaelia.org/Home Core Approach: Concurrent things with comms points Generally send messages Keep data private, don't share inbox control ... outbox signal ... inbox control ... outbox signal ...
  • 8. Michael Sparks BBC R&D, http://www.kamaelia.org/Home But I must share data? Use Software Transactional Memory ie version control for variables. 1. Check out the collection of values you wish to work on 2. Change them 3. Check them back in 4. If conflict/clash, go back to 1
  • 9. Michael Sparks BBC R&D, http://www.kamaelia.org/Home Perspectives in APIs! (1/2) 1st , 2nd , 3rd Person inbox control ... outbox signal ... 1st Person - I change my state 2nd Person – YOU want to me to do something (you send me a message) 3rd Person – Bla should do something (I send a message)
  • 10. Michael Sparks BBC R&D, http://www.kamaelia.org/Home inbox control ... outbox signal ... private real methods Messages from public inboxes Messages sent to public outboxes Perspectives in APIs! (2/2) 1st , 2nd , 3rd Person Also, think about stdin Also, think about stdout
  • 11. Michael Sparks BBC R&D, http://www.kamaelia.org/Home inbox control ... private real methods Messages from public inboxes Actor Systems Distinction can be unclear, potential source of ambiguity* No outbox concept Possible issues with rate limiting* Hardcodes recipient in the sender *system dependent issue
  • 12. Michael Sparks BBC R&D, http://www.kamaelia.org/Home Advantages of outboxes inbox control ... outbox signal ... No hardcoding of recipient allows: - Late Binding - Dynamic rewiring Concurrency Patterns as Reusable Code ... a concurrency DSL
  • 13. Michael Sparks BBC R&D, http://www.kamaelia.org/Home A Core Concurrency DSL Pipeline(A,B,C) Graphline(A=A,B=B, C=C, linkages = {}) Tpipe(cond, C) Seq(A,B,C), PAR(), ALT() Backplane(“name”), PublishTo(“name”), SubscribeTo(“name”) Carousel(...) PureTransformer(...) StatefulTransformer(...) PureServer(...) MessageDemuxer(...) Source(*messages) NullSink Some of these are work in progress – they've been identified as useful, but not implemented as chassis, yet
  • 14. Michael Sparks BBC R&D, http://www.kamaelia.org/Home Pipeline Example Pipeline( MyGamesEventsComponent(up="p", down="l", left="a", right="s"), BasicSprite("cat.png", name = "cat", border=40), ).activate() MyGames Events Component Basic Sprite
  • 15. Michael Sparks BBC R&D, http://www.kamaelia.org/Home Graphline Example Graphline( NEXT = Button(...), PREVIOUS = Button(...), FIRST = Button(...), LAST = Button(...), CHOOSER = Chooser(...), IMAGE = Image(...), ... ).run() FIRST (button) Chooser LAST (button) PREVIOUS (button) NEXT (button) Image
  • 16. Michael Sparks BBC R&D, http://www.kamaelia.org/Home Server Example Main Server Core Remote User Protocol Handler Factory Socket handler Protocol handler data to user data from user Created at runtime to handle the connection
  • 17. Michael Sparks BBC R&D, http://www.kamaelia.org/Home Server Example Main Server Core Protocol Handler Factory You therefore need to provide this bit.
  • 18. Michael Sparks BBC R&D, http://www.kamaelia.org/Home Server Example from Kamaelia.Chassis.ConnectedServer import ServerCore from Kamaelia.Util.PureTransformer import PureTransformer def greeter(*argv, **argd): return PureTransformer(lambda x: "hello" +x) class GreeterServer(ServerCore): protocol=greeter port=1601 GreeterServer().run()
  • 19. Michael Sparks BBC R&D, http://www.kamaelia.org/Home Backplane Example # Streaming Server for raw DVB of Radio 1 Backplane(“Radio”).activate() Pipeline( DVB_Multiplex(850.16, [6210], feparams), # RADIO ONE PublishTo("RADIO"), ).activate() def radio(*argv,**argd): return SubscribeTo(“RADIO”) ServerCore(protocol=radio, port=1600).run()
  • 20. Michael Sparks BBC R&D, http://www.kamaelia.org/Home Thank you for listening! If you have questions, grab me later :-)