SlideShare a Scribd company logo
Time Travel!
Predicting the Future !
and Surviving a Parallel Universe !
                                      Hossam Karim!
The Free Lunch is Over!!
Welcome to the Real World!
Concurrency!
It’s Pretty Hard!
Concurrency Pain!
Doubled-Checked Locking Problem


!"#$%&!&$'((!"#$%&'()'*+',-#*+./0!1!
!!
!!!!)%*'+,!234'/5.6'7'5#$8*'!'34'/5.6'7'5#$8*'9!
!!
!!!!"#$%&!234'/5.6'7'5#$8*'!0':234'/5.6'7'5#$*';<!1!
!!!!!%-!;'34'/5.6'7'5#$8*'!==!."$$<!
!!!!!!!'34'/5.6'7'5#$8*'!=!.,/!234'/5.6'7'5#$8*';<9!
!!!!!),+").!'34'/5.6'7'5#$8*'9!
!!!>!
!!
!>!
Doubled-Checked Locking Problem


!"#$%&!&$'((!"#$%&'()'*+',-#*+./0!1!
!!
!!!!)%*'+,!234'/5.6'7'5#$8*'!'34'/5.6'7'5#$8*'9!
!!
!!!!"#$%&!234'/5.6'7'5#$8*'!0':234'/5.6'7'5#$*';<!1!
!!!!!%-!;'34'/5.6'7'5#$8*'!==!."$$<!1!
!!!!!!!(/.&0)1.%2,3!;"#$%&'()'*+',-#*+./0>&$'((<!1
!!!!!!!!!'34'/5.6'7'5#$8*'!=!.,4!234'/5.6'7'5#$8*';<9!
!!!!!!!?!
!!!!!?!
!!!!!),+").!'34'/5.6'7'5#$8*'9!
!!!?!
!!
!?!
Doubled-Checked Locking Problem

!"#$%&!&$'((!"#$%&'()'*+',-#*+./0!1!
!!
!!!!)%*'+,!234'/5.6'7'5#$8*'!'34'/5.6'7'5#$8*'9!
!!
!!!!"#$%&!234'/5.6'7'5#$8*'!0':234'/5.6'7'5#$*';<!1!
!!!!!%-!;'34'/5.6'7'5#$8*'!==!."$$<!1!
!!!!!!!(/.&0)1.%2,3!;"#$%&'()'*+',-#*+./0>&$'((<!1!
!!!!!!!!!%-!;'34'/5.6'7'5#$8*'!==!."$$<!
!!!!!!!!!!!'34'/5.6'7'5#$8*'!=!!
!!!!!!!!!!!!!!!.,4!234'/5.6'7'5#$8*';<9!
!!!!!!!?!
!!!!!?!
!!!!!),+").!'34'/5.6'7'5#$8*'9!
!!!?!
!!
!?!
!!
!
Doubled-Checked Locking Problem




                                      volatile




Thread A



Thread B

                          Processor               Main
                            Cache                Memory

           synchronized
Doubled-Checked Locking Problem

!"#$%&!&$'((!"#$%&'()'*+',-#*+./0!1!
!!
!)%*'+,!*-$'+%$,!234'/5.6'7'5#$8*'!'34'/5.6'7'5#$8*'9!
!!
!!!!"#$%&!234'/5.6'7'5#$8*'!0':234'/5.6'7'5#$*';<!1!
!!!!!%.!;'34'/5.6'7'5#$8*'!==!/"$$<!1!
!!!!!!!(0/&1)-/%2,3!;"#$%&'()'*+',-#*+./0>&$'((<!1!
!!!!!!!!!%.!;'34'/5.6'7'5#$8*'!==!/"$$<!
!!!!!!!!!!!'34'/5.6'7'5#$8*'!=!!
!!!!!!!!!!!!!/,4!234'/5.6'7'5#$8*';<9!
!!!!!!!?!
!!!!!?!
!!!!!),+")/!'34'/5.6'7'5#$8*'9!
!!!?!
!!
!?!
Scala
!"#$$!"#$%$&'(()*+,%(-.(#/(01*#/234!5!
!!!!
!!!"#%&!'#"!(67(3829(:(8*+'#(!;!()*!<67(3829(:(8*+'#(!
!!
=!


!
                                                                 Decompiled into Java
!!"#$$!"#$%$&'(()*+,%(-.(#/(01*#/234!%&'"(&()*$!!"#$#%&'(")!5!
!!!'+%,#*(!678(392:(;(9*+'#(!(78(392:(;(9*+'#(<!
!!!'-."%!!,/"#*%"(!%)*!,2=>$8?@<!
!!
!!!'-."%!!678(392:(;(9*+'#(!(78(392:(;(9*+'#(AB!5!
!!!!!%0!AA*1%$C,2=>$8?@!D!@7EB!FF!@B!
!!!!!$2)!1+/)%3(4!A*1%$B!5!
!!!!!!!%0!AA*1%$C,2=>$8?@!D!@7EB!FF!@B!5!
!!!!!!!!!*1%$C(78(392:(;(9*+'#(!F!)(5!678(392:(;(9*+'#(AB<!
!!!!!!!!!*1%$C,2=>$8?@!GF!E<!
!!!!!!!H!
!!!!!!!+(*-+)!*1%$C(78(392:(;(9*+'#(<!
!!!!!H!
!!!H!
!H!
!!
!
Concurrency Models!
Concurrency Models




                           !"#$%&&'#()*&"+&,--.#+)
                                   /"0'1




                !"--%#.$,(."#                  23#$4&"#.5,(."#




24,&'0)/'-"&3     /'66,+')*,66.#+             7%6389,.(.#+            71"$:.#+




                                                             2'-,;4"&'6          /"#.("&6
Multi-threading Approach!
Thread Pools and Executors
!
!!!"#!"#$%&'()%*&+,,-./#0%12!34/5!4'()%*&12!34/6!7!
!!!!!$%&!8,,-!9!:$%;</,)1=4%>?#$%&'()%*&+,,-.4'()%*&16!
!!!!!$%&!)%1<-/!9!@%4;(0*)A./#0%')*B%-C%"#4#/#,46!7!
!!!!!!!#48</!!!
!!!!!!!!!#'(!.D!E!F!/,!/#0%16!7!
!!!!!!!!!!!8,,-=%$%;</%!7!
!!
!!!!!!!!!!!!!)"*!!"##$%&'!7!
!!!!!!!!!!!!!!!!"#!)<4.6!7!
!!!!!!!!!!!!!!!!!%4;&%;.#48</6!
!!!!!!!!!!!!!!!G!
!!!!!!!!!!!!!G!
!!
!!!!!!!!!!!G!
!!!!!!!!!G!
!!!!!!!!!8,,-=1(</&,>4.6!
!!!!!!!!!8,,-=*>*#/'%)0#4*/#,4.F5!()*'+#),=H3IJ':K6!
!!!!!G!
!!!!!-,L=#4",.M"#$%&'()%*&+,,-2!C,4%!N&!O,@1!<1#4L!N&!'()%*&1!#4!N&!01M=!
!!!!!!!",)0*/./#0%15!4'()%*&15!)%1<-/=/#0%H#--#166!
!!G!
!!
Java Fork-Join Framework!
Fork-Join Framework


                                                       join
                                      fork
                                                               join
ForkJoinTask                  fork
                fork

                                                                          join



                                  Deque                            Worker
                             per Worker Thread                   Thread Pool


                   !"#$%                         !&!%'()*+,%
         fork
                 -./0
                '*)*+,%     Work
                           Stealing

                                                 !&!%'()*+,%
                   !"#$%
         fork
Fork-Join Framework
!
!!"#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./B@7.*-3!$-0*./B/'+-L'..'088!
!!!
!G!
!!
!
Parallel Collections!
Parallel Collections - Mathematica

            ParametricPlot3D CosΦ SinΘ, SinΦ SinΘ, CosΘ,
 In[1]:=   plotSpherefactor_ :

             Φ, 0, 2 Π, Θ, 0, Π, PlotPoints  100, Mesh  None,
             ColorFunction  Functionx, y, z, Φ, Θ,
               HueSinfactor Φ Sinfactor Θ, ColorFunctionScaling  False,
             Axes  None, Boxed  False, ImageSize  100
           LaunchKernels
           DistributeDefinitionsplotSphere

Out[2]=    KernelObject1,   local,   KernelObject2,   local,
            KernelObject3,   local,   KernelObject4,   local,
            KernelObject5,   local,   KernelObject6,   local,
            KernelObject7,   local,   KernelObject8,   local

Out[3]=    plotSphere
Parallel Collections - Mathematica
Parallel Collections - Mathematica
Scala Parallel Collections

!!!#!#$%#'$()#*+!#',!-#%'*+!$%'().+!*+%,/#'0!1!2!
!!!!!-./!(34%56'),!78%94%56').!1!
!!!!!!!:'5%8*()#*;#$%+!=.;!
!!!!!!!!!34(!
!!!!!!!!!!!-#'!!!(0!#'(?@$A@$?;-8*34%()#*;B'%C4%6,!-#'...;!
!!!!!!!!!4*%#%#87(;B'%D43';'7)$E#%6(-#%'*..!
!!
!!!!!-./!56#)F#*'5%8*#'$!1!78%94%56');4BB*'B4%'(:'5%8*;'3%G/#'0.(!
!!!!!2!
!!!!!!!(H'5%8*,!-#'.!!!
!!!!!!!!!'#!(-#';#$F#*'5%8*G.!H'5%8*!+I!-#'!/1!H'5%8*!
!!!!!J!
!!!!!,!!II!.!
!!
!!!!!34%56')!II!56#)F#*'5%8*#'$;-8)K'-%(:'5%8*;'3%G/#'0.!2!
!!!!!!!(H'5%8*,!)#*.!!!H'5%8*!II!#$%#'$()#*,!-#%'*.!
!!!!!J!
!!!J!
Scala Parallel Collections
!!!#$%'()!
!!!!#!%*#+%(*,()-!
!!!!!$)).!$%'(/+%(01!2%'*.!$%'(/+%(01!3%#('.!)(*+,4.!$%'(/+%(0!5!6!
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#'#$F#*'2%3*G0!H'2%3*!-I!/#'!,/!H'2%3*!
!!!!!J!
!!!!!.!=!II!=0!
!!!!!8)%29',!II!29#,F#*'2%3*#'$-+/)%;)?+#$%#'$()*)'+=.!/#%'*00!
!!!J!
!!
!
Scala Parallel Collections
Message Passing!
Akka Actors

                                                              !#$%'(#)*




                                            !#$%                   !#$%                           !#$%
2%$3/)456$%7




                                                                                                                    '()%*+,$%,
 8%)970$:1




                       ,9/9#+$1
                       ;),($1,)




                                                                                                                     -.+/0%)1
                                    !#$%           !#$%   !#$%           !#$%           !#$%           !#$%




                             !
                                                                                3).9*+$%@      !#$%
                                                                      %))+*)
               !#$%
                                                            =9+/3$?
                                     =),,9)                                                   %)(/A@4),,9)
Akka Actors
!
!#$%!#$$!#$%'('))#*'+$'))#*',!'()*+,-!
!!
!
!
!-%.!).$%'/01234)1'$+-!5!
!!!!!/#!)4)1'$!6!/01234)1'$+7$#.8/01234)1'$7-!
!
!!!!!/#!)#$%'/0123!6!!
!!!!!!!)4)1'$9#0123:;+32%)=#$%'/0123?!8#$'!6!7)#$%'/01237-!
!
!!!!!/#!@''*#1'/0123!6!!
!!!!!!!)4)1'$9#0123:;+32%)=A''*#1'/0123?!8#$'!6!7@''*#1'/01237-!
!
!!!!!)#$%'/0123!B!7C'27!
!!!!!)#$%'/0123!B!#$%'('))#*'+7DAEFGHIG7-!
!
!!!!!)4)1'$9)CJ1@2K8+-!
!L!
!!
!
!
Akka Actors

!
!!#$$!#$%'()*+,!%'%()$!!#$%!-!
!!
!!!*#!+.!/!0+..12.3)+2*'4*5676*'$8!'+,$9!
!!
!!!*#!:''.#*'()*+,!/!!
!!!!!!)+2*'4*5#)*+,;+,3#==#??$#12()*+,76*'$?@6',?:''.#*'()*+,9!
!
!!!)%-!,')'1A'!/!-!
!!!!!!#$%!6!.'/,(0!!!
!!!!!!!+.512B+369!
!
!!!!!!#$%!+*C',!!!!!!!
!!!!!!!+.512B+3D#2E*!C#2:'!*C16!+2'8!F1!:''.#*'!*+!#2+*C',!#)*+,9!
!!!!!!!:''.#*'()*+,!G!+*C',!
!!!H!
!H!
!!
!
Akka Actors

!
!!#$$!#$#%'#()'*+!%'%()$!!#$%!,!
!!!*#!$*%!-!.*%%/0%1)*0'#2'3454'#67!'+,$8!
!!
!!!)%-!+#)#/9#!-!,!
!!
!!!!!!#$%!:6;$##44%#16#44%#8!!!
!!!!!!!$*%3/0=*1?#)#/9#@!6#44%#!A43=*+6'16#44%#88!
!!
!!!B!
!B!
!!
!
Akka Futures




                 ./0$1-$2!#$%3)*4,$5
                                                   !#$%+,*$-



                   !#$%3)*4,$./0$1--)6(%

!#$%'#(()(*
                                          76(%4#-(189$:4$%-




 9$16;;$(2-)6(%                                    3)((1)#
                                                   76(%4#-(-%
Akka Futures

                                                              !
                                                              !!#!#$#%'$%($)*+,!!#$%-'(#-'$%($).'/0$*1233!4!
                                                              !!!$%!5!
                                %#$%+,*$-./-0,              !!!!!'(/+6*)#%78(/#9!:!!
                                                              !!!!!!!7+(/+;(%)$0$1%!=!'(/+6*)#%?#+$7'()!@($99AB(C;1-'(/+6*)#%3!
                                                              !!!!!!!!!+$%($)*+!:!!
                                                              !!!!!!!!!!!6#$#%A$%(8%+7012+#/$(20.0$1%+97!
                                                              !!!!!!!!!!!!!(0$1%!!!7(0$1%!=!'$%($).?#+$78(/#99AB(C;1-'$%($).'/0$*1239!
        !#$%1)*2,$3$42$%-
                                                              !!!D!*+(#,!+$%($)*+!
                                                              !!
                             !#$%1)*2,$                      -!#!#$#%01BB2E($*12+,!!#$%-'(#-)#$*#%+,33!4!
                                                              !!!#$#%'$%($)*+AB(C7!
                                                              !!!!!/*+$F'$%($).'/0$*12!!
                                                              /*+$F'$%($).'/0$*12A/($G(C7HA%01BB2E($*12+99!
                                                              !!
  !#$%'#(()(*               !-,-$*53$42$%-           !




3$/066$(7-)0(%                       /0(%2#-(/5./-0,



                                                             /0(%2#-(/5./-0,




                                                                                /0(%2#-(/5./-0,
Akka Futures
!
!!#!#$#%'$%($)*+,!!#$%-'(#-'$%($).'/0$*1233!4!
!!!$%!5!
!
!!!!!'(/+6*)#%78(/#9!:!!
!!!!!!!7+(/+;(%)$0$1%!=!'(/+6*)#%?#+$7'()!@($99AB(C;1-'(/+6*)#%3!
!
!!!!!+$%($)*+!:!!
!!!!!!!6#$#%A$%(8%+7012+#/$(20.0$1%+97!
!!!!!!!!!!!!!(0$1%!!!7(0$1%!=!'$%($).?#+$78(/#99AB(C;1-'$%($).'/0$*1239!
!
!!!D!*+(#,!+$%($)*+!
!!
-!#!#$#%01BB2E($*12+,!!#$%-'(#-)#$*#%+,33!4!
!!!#$#%'$%($)*+AB(C7!
!!!!!/*+$F'$%($).'/0$*12!!
/*+$F'$%($).'/0$*12A/($G(C7HA%01BB2E($*12+99!
!!
!
                                                                 Akka Promises
!!!!#$!!%##!#$#%'($)%*+!'()*+,!
!!
!!!!%##!-.(*/01*0#!2!!
!!!!!,%!3#*1!4!56#./3#*1'7$88$7,!
!!!!!)-.%)!)'!,%!*6!4!3#*19:;$#6=*/!!
!!
!!!!!/$0!)*$**))?@%/A%#%/*+!!#$%'B#$#%C!4!2!
!!!!!!!,%!D.(*/01*0#E/.1;*!4!E/.1;*B#$#%C',!
!!!!!!!A%#%/*!2!:..1*FG#/*1*)3H$/:#%II'D.(*/01*0#E/.1;*,!J!
!!!!!!!).D9;0I.'7K*L/*!#=*!D.(*/01*0#M!:.0L#!6$))!%M!N*!N;))!6$))!3.%7,!
!!!!!!!D.(*/01*0#E/.1;*!
!!!!!J!
!!
!!!!!/$0!:..1*FG#/*1*)3H$/:#%II'/.1;*+!!#$%'B#$#%C,!2!
!!!!!!!).D9;0I.'!
!!!!!!!!!7K*L/*!#=*!D.(*/1*0#M!N*!);(*!;0!$!$/$))*)!N./):!6$))*:+!O79!
!!!!!!!!!!!I./1$#'=/*$:96%//*0#=/*$:',9D*#P$1*,,!
!!!!!!!).D9;0I.'!
!!!!!!!!!7K*L/*!#=*!D.(*/01*0#M!N*L/*!D.;0D!#.!)**!I./!$!N=;)*7,!
!!!!!!!=/*$:9)**'QRRR,!
!!!!!!!/.1;*9%66*'#$#%'7K.0:*/I%)7,,!
!!!!!J!
!!
!!!!!/$0!#=$08503N$3',!2!
!!!!!!!3#*19=%#:.N0',!
!!!!!J!
!!!J!
!!
!
Akka Promises

!
!!!!#!#$%'()*+,-!.!
!!
!!!!!$%!/)0$#*1$*(!2!'(!3)0$#*1$*(!
!!
!!!!!$%!/)0$#*1$*(4#)1+$!2!/)0$#*1$*(56$7+$8$669+:;#;(;#$!
!!
!!!!!6)/5*=),?$@#$!(A$!$)6$B!C$!7+D$%!E);!7!F;$+()*-!
!!
!!!!!!!#$%'()*+$*,-./%0+1-+12($2+$$-34)%*)%/05$$6)--3-3!
!!!!!GC7(5#$7%E,/)0$#*1$*(4#)1+$B!HI!+$')*%+-!!!%/786-5/1!
!!
!!!!!/)0$#*1$*(4#)1+$!)*J;''$++!.!
!!!!!!!)%*!J(7(;+,076;$-!!!
!!!!!!!!!6)/5*=),!
!!!!!!!!!!:;#!/)0$#*1$*(!=*766E!#$6$%B!(A$E!+7E!(@+!K+5=)#17(,076;$--!
!!!!!L!)*76;#$!.!
!!!!!!!)%*!$!!!
!!!!!!!!!6)/5$##)#,:)+B!+)##E5!3))%!6;'D!*$M(!(1$!N--!
!!!!!L!
!!
!!!!!/)0$#*1$*(5(A7*D+G*EC7E,-!
!!!L!
!!
!!
!
Relations to Functional Programming!
Selected	
  Topics	
  
Monoid




                                            !#$%'()




                                            !*%%$+,-.,/,.0)




                                            !12(3.,.0)




!#$#%'(('!)#*#+          !#$#%#)#*#+

,!#$'(('!%#)-'(('!*#+   !#$#%#)#*#+
!#$'((',!%#)'(('!*#+-

!#$#%'(('!               !#$#%
!'(('!#$#%
Monoid



 !#$%




'()*%+
,-.+.//%/0




 1%+2%
Immutable Data Structures – Google’s Guava
!
!!#$%!!#$#$%'()!**+$,-./01../2$1'345!6!
!!!!!!#$#$%'()!3$%'(3!7!
!!!!!!!%'$()*+!#$8#$%'())'*,+-458!
!!!!!!!!!,994:;11(./3:58!
!!!!!!!!!,994:;+,=,:58!
!!!!!!!!!,994:+.9/%3:58!
!!!!!!!!!-+.945?!
!!!!!..#$-/0#1(,,2345$675##)*+389!
!!!!!'()'*!3$%'(3?!
!!!@!
!!
   h.p://code.google.com/p/memory-­‐measurer/wiki/ElementCostInDataStructures	
  
!
                                                  Immutable Data Structures – Scala
!
!!#!#$%$''()$*%+,-)!.!
!!!/0#$%$/!11!/''()$*%+/!11!/,-)/!11!2-%!
!!
!   h.p://en.wikipedia.org/wiki/Persistent_data_structure	
  
Persistent Data Structures
                !

    %      '   !!#!#$%$'()$*+!,!-.-!//!-0-!//!-1-!//!-2-!//!3$(!
                !!!!!!
                !!#!4)$*+!,!-5-!//!#$%$'()$*+!
                !!
!               !!#!6)$*+!,!#$%$'()$*+!$%'!7!
                !!!!()!89':!//!+'$(!!!-;-!//!+'$(!


                !!!!()!!!!!!!!!!!!!!!-;-!//!3$(!
                !=!
                !!!!!!

#
                !!#!)$*+!,!#$%$'()$*+!$%'!7!
                !!!!()!?$#*+!//!*9@:!//!+'$(!!!-A-!//!+'$(!
                !!!!()!!!!!!!!!!!!!!!!!!!!!!!!!!-A-!//!3$(!

$               !=!
                !!
                !
Thank You!

More Related Content

PDF
Managing SQL Performance
PDF
The book small
PDF
what’s wrong with the philippine higher education
PDF
Death By Ppt
PDF
Paras Holidays Europe USA Group Tours 2015 Brochure
PDF
CCM IDL, CORBA Component Model IDL
PDF
Investment in the Silicon Valley Mobile Industry
PDF
Zahra integrated cal+letter for sangopita
Managing SQL Performance
The book small
what’s wrong with the philippine higher education
Death By Ppt
Paras Holidays Europe USA Group Tours 2015 Brochure
CCM IDL, CORBA Component Model IDL
Investment in the Silicon Valley Mobile Industry
Zahra integrated cal+letter for sangopita

What's hot (18)

KEY
Evolving systems and the link to service orientation
PDF
Observatoire des taxes foncières - Période 2012 / 2017
PDF
Ipad gump
PDF
Catch this pitch!
PDF
NantKwest Chairman & CEO Dr. Patrick Soon-Shiong to Present Vision for Next G...
PDF
Articulo 416 LeCrim. La dispensa de la Obligación de Declarar.
PDF
Amidds Wbc 2013
PDF
EDUTEC-e: "Innovando en la Educación para la empleabilidad y el desarrollo de...
PDF
52 ways to_lose_weight_all_year
KEY
Massive device deployment - EclipseCon 2011
PDF
دراسة تحليلة لمشروع التصميم الحضري لمنطقة سد كمران
KEY
Device deployment
PDF
PDF
Intergrating OER in Educational Practice: Practitioner Stories
PDF
WestEd Evaluation of Hawaii Special Education Program
PDF
Aar fourmile fire_dct-vct_jan2011_pdf
PDF
Accessing and Using Food Data to Support Collaborative Policy Decisions - Pow...
PDF
Os Pruett Sessionnotes
Evolving systems and the link to service orientation
Observatoire des taxes foncières - Période 2012 / 2017
Ipad gump
Catch this pitch!
NantKwest Chairman & CEO Dr. Patrick Soon-Shiong to Present Vision for Next G...
Articulo 416 LeCrim. La dispensa de la Obligación de Declarar.
Amidds Wbc 2013
EDUTEC-e: "Innovando en la Educación para la empleabilidad y el desarrollo de...
52 ways to_lose_weight_all_year
Massive device deployment - EclipseCon 2011
دراسة تحليلة لمشروع التصميم الحضري لمنطقة سد كمران
Device deployment
Intergrating OER in Educational Practice: Practitioner Stories
WestEd Evaluation of Hawaii Special Education Program
Aar fourmile fire_dct-vct_jan2011_pdf
Accessing and Using Food Data to Support Collaborative Policy Decisions - Pow...
Os Pruett Sessionnotes
Ad

Similar to Time Travel - Predicting the Future and Surviving a Parallel Universe - JDC2012 (20)

PDF
Fork Join (BeJUG 2012)
PPTX
Fork and join framework
PDF
Multi-core Parallelization in Clojure - a Case Study
KEY
Fork/Join for Fun and Profit!
PDF
A Java Fork_Join Framework
PDF
C# Advanced L04-Threading
PPTX
Programming Java - Lection 07 - Puzzlers - Lavrentyev Fedor
PDF
Simon Peyton Jones: Managing parallelism
PDF
Peyton jones-2011-parallel haskell-the_future
PDF
Event Stream Processing with Multiple Threads
PDF
Transactional Memory for Smalltalk
PDF
Sioux Hot-or-Not: Functional programming: unlocking the real power of multi-c...
PDF
Java 7 Launch Event at LyonJUG, Lyon France. Fork / Join framework and Projec...
PDF
What can be done with Java, but should better be done with Erlang (@pavlobaron)
PDF
Keynote joearmstrong
PPT
BayFP: Concurrent and Multicore Haskell
PDF
近未来的並列 LL
PDF
GPars For Beginners
PDF
[Greach 17] make concurrency groovy again
Fork Join (BeJUG 2012)
Fork and join framework
Multi-core Parallelization in Clojure - a Case Study
Fork/Join for Fun and Profit!
A Java Fork_Join Framework
C# Advanced L04-Threading
Programming Java - Lection 07 - Puzzlers - Lavrentyev Fedor
Simon Peyton Jones: Managing parallelism
Peyton jones-2011-parallel haskell-the_future
Event Stream Processing with Multiple Threads
Transactional Memory for Smalltalk
Sioux Hot-or-Not: Functional programming: unlocking the real power of multi-c...
Java 7 Launch Event at LyonJUG, Lyon France. Fork / Join framework and Projec...
What can be done with Java, but should better be done with Erlang (@pavlobaron)
Keynote joearmstrong
BayFP: Concurrent and Multicore Haskell
近未来的並列 LL
GPars For Beginners
[Greach 17] make concurrency groovy again
Ad

Recently uploaded (20)

PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Cloud computing and distributed systems.
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Empathic Computing: Creating Shared Understanding
PDF
Approach and Philosophy of On baking technology
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Electronic commerce courselecture one. Pdf
PDF
Machine learning based COVID-19 study performance prediction
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
NewMind AI Weekly Chronicles - August'25 Week I
Review of recent advances in non-invasive hemoglobin estimation
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Unlocking AI with Model Context Protocol (MCP)
MYSQL Presentation for SQL database connectivity
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Cloud computing and distributed systems.
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Empathic Computing: Creating Shared Understanding
Approach and Philosophy of On baking technology
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Electronic commerce courselecture one. Pdf
Machine learning based COVID-19 study performance prediction
Building Integrated photovoltaic BIPV_UPV.pdf
20250228 LYD VKU AI Blended-Learning.pptx
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx

Time Travel - Predicting the Future and Surviving a Parallel Universe - JDC2012