Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Ponylangとこれからの並行プログラミング

234 views

Published on

HackerTackle 2018の発表資料
http://hackertackle.github.io/2018/

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Ponylangとこれからの並行プログラミング

  1. 1. Ponylang 2018/02/17 Hacker Tackle 2018 @matsu_chara
  2. 2. - @matsu_chara - FOLIO Scala - Pony 2
  3. 3. 1. 2. Concurrency 3. Ponylang 4. Ponylang
  4. 4. Pony - - - 2015 v0.1 - pre v1.0
  5. 5. 1
  6. 6. - Pony - -
  7. 7. - - =>
  8. 8. Concurrency 2
  9. 9. Concurrency - - ※
  10. 10. Concurrency data-race, deadlock, … /
  11. 11. - Shared Memory & Synchronization - Actor Model -
  12. 12. 1. Shared Memory & Synchronization - - - -
  13. 13. Synchronization - lock deadlock - lock - lock
  14. 14. 2. Actor model - Actor - Actor Message Passing - Actor - Actor - 1 Actor 1 Actor Actor ActorActor
  15. 15. Actor model - - - - ※ Actor Actor ActorActor
  16. 16. Actor
  17. 17. Actor model - - Message Shared-Memory
  18. 18. class Counter extends Actor { val set = mutable.Set[Int]() def receive = { case data: Int => set.add(data) resetter ! set } } class Resetter extends Actor { def receive = { case set: mutable.Set[_] => if(set.size > 10) set.clear() } } mutable ※ code Pony ※ scala var + immutable copy https://doc.akka.io/docs/akka/2.5.6/scala/general/jmm.html#actors-and-shared-mutable-state race-condition
  19. 19. ( )
  20. 20. ( ) - data-race dead-lock Actor
  21. 21. ( ) - data-race dead-lock Actor -
  22. 22. ( ) - data-race dead-lock Actor - -
  23. 23. Pony - data-race dead-lock Actor - - -
  24. 24. Ponylang 3
  25. 25. Actor model Shared Memory - Pony Deny Capabilities for Safe, Fast Actors - -
  26. 26. - Transfer Isolated State - Share Immutable - ※ https://github.com/jemc/slides-pony
  27. 27. a. Transfer Isolated State - - -
  28. 28. a. Transfer Isolated State Pros - zero-copy mutable Cons -
  29. 29. b. Share Immutable State - Immutable
  30. 30. Share Immutable State - mutable immutable - mutable - Immutable - write - write-unique
  31. 31. immutable? mutable?write-unique? Pony Reference Capability ※ val
  32. 32. Reference Capability
  33. 33. iso - Isolated - read/write unique - - - Transfer Isolated State
  34. 34. iso isoな参照
  35. 35. iso write-uniqueなので writeできる
  36. 36. iso isoな参照を増やそうとすると read/write�uniqueで なくなるのでコンパイルエラー
  37. 37. iso consumeで参照を破棄 他アクターに渡す
  38. 38. iso consume後に参照すると コンパイルエラー
  39. 39. val - Immutable - - - read - Share Immutable State
  40. 40. trn - Transition - - Write Unique - val
  41. 41. capability - box: Read Only - ref: mutable - tag: read/write 6
  42. 42. Ponylang 4
  43. 43. - Pony GC read/write barrier [1][2] - - - Pony
  44. 44. Wallaroo - Pony Stream - Python/Go binding - - Why we used Pony to write Wallaroo reddit Pony Rust https://www.wallaroolabs.com/
  45. 45. Distributed Pony - Pony - work-steeling - - GC - Pony
  46. 46. - runtime Pony - Concurrency Pony - (pony )

×
Save this presentationTap To Close