Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Rinda in the real-world embedded systems.

Rinda in the real-world embedded systems.

RubyKaigi takeout 2020

seki at druby.org

September 04, 2020
Tweet

More Decks by seki at druby.org

Other Decks in Programming

Transcript

  1. Rinda
    in the real-world embedded systems.
    [email protected]

    View full-size slide

  2. About Me
    @m_seki
    My works
    Ruby committer
    2

    View full-size slide

  3. First printing from 2005 (Still available)
    dRuby
    ʹΑΔ
    ؔকढ़ஶ
    ෼ࢄ
    ɾ
    Web
    ϓϩάϥϛϯά

    View full-size slide

  4. Become out of print in 2014

    View full-size slide

  5. 2017 re-published on the web

    View full-size slide

  6. 2020 dRubyͰָ͠Ή෼ࢄΦϒδΣΫτ
    n-monthly Lambda Note Vol.2 No.1

    View full-size slide

  7. Ruby Committer
    ERB, dRuby, Rinda
    7

    View full-size slide

  8. Linda and Rinda
    Linda: coordination language
    tuple space
    Rinda as Ruby Linda
    8

    View full-size slide

  9. process, tuple, tuple space
    process
    9

    View full-size slide

  10. process, tuple, tuple space
    tuple
    10

    View full-size slide

  11. process, tuple, tuple space
    tuple space
    11

    View full-size slide

  12. How to write Parallel Programs
    12

    View full-size slide

  13. Embedded systems
    Report embedded systems using rinda
    not ERB (embedded ruby)
    13

    View full-size slide

  14. OAOWFC
    Okayama Astrophysical Observatory Wide-Field Camera
    Publications of the Astronomical Society of Japan, Volume 71, Issue 6,
    December 2019, 118, https://doi.org/10.1093/pasj/psz117
    ୈ5ճ Մࢹ੺֎ઢ؍ଌ૷ஔٕज़ϫʔΫγϣοϓ 2015೥12݄
    ʮԬࢁఱମ෺ཧ؍ଌॴ޿ࢹ໺੺֎Χϝϥͷ੡࡞ʯ༄ᖒɹ
    ݦ࢙ʢࠃཱఱจ୆ʣ https://www.astr.tohoku.ac.jp/~akiyama/
    astroinst2015/20151207_yanagisawa.pdf
    14

    View full-size slide

  15. ϩϘοτ๬ԕڸʁ
    robot telescope?

    15

    View full-size slide

  16. OAOWFC
    20151207_yanagisawa.pdf ΑΓ
    OAOWFC
    Okayama Astrophysical Observatory Wide Field Camera
    2015/12/07 奛㷔塭伖㈨埻WS 7
    16

    View full-size slide

  17. f/2.5
    20151207_yanagisawa.pdf ΑΓ
    2/07 奛㷔塭伖㈨埻WS 16
    17

    View full-size slide

  18. renewal of the existing classical Cassegrain telescope
    20151207_yanagisawa.pdf ΑΓ
    The OAO 0.9m Telescope before renewal
    ͻ Manufacturer : NIKON (present)
    ͻ Completion: 1959
    ͻ Mount : Fork Equatorial
    ͻ Slew Speed: 1.5 deg / sec
    ͻ Manufacturer : IHI
    ͻ Completion: 1959
    ͻ Rotation Speed: 3.0 deg / sec
    2015/12/07 奛㷔塭伖㈨埻WS 11
    18

    View full-size slide

  19. renewal of the existing classical Cassegrain telescope
    20151207_yanagisawa.pdf ΑΓ
    The OAO 0.9m Telescope before renewal
    ͻ Manufacturer : NIKON (present)
    ͻ Completion: 1959
    ͻ Mount : Fork Equatorial
    ͻ Slew Speed: 1.5 deg / sec
    ͻ Manufacturer : IHI
    ͻ Completion: 1959
    ͻ Rotation Speed: 3.0 deg / sec
    2015/12/07 奛㷔塭伖㈨埻WS 11
    19

    View full-size slide

  20. primary pupose
    20151207_yanagisawa.pdf ΑΓ
    2015/12/07 奛㷔塭伖㈨埻WS 34
    ྂ඾ⓗ䝉䝣䜯䜲䝗ೃ⿵䛾఩⨨
    DDO Cepheid DB
    OAOWFC
    20

    View full-size slide

  21. OAOWFC
    20151207_yanagisawa.pdf ΑΓ
    21

    View full-size slide

  22. autonomous
    weather monitor
    auto focus
    cooperative operation
    22

    View full-size slide

  23. 20151207_yanagisawa.pdf ΑΓ
    23

    View full-size slide

  24. auto focus
    tube length monitor
    20151207_yanagisawa.pdf ΑΓ
    -\]O^_`Oabcd%
    ]O^_`Oabcd+1
    ef)ghiX$jk.le
    mn)_oONpSqcd@1
    rst/_`Oabuv=
    iX[D_oONpSq&' . wdx8yz[DE'5%
    %
    {u1|}eef)gh=iX[1~e@le)•Ä=
    ÅÇ$ÉÑÖÜá=yz&'Là$•Äâä=ãå[e
    f$çé$>n[Lèê . ëíì
    5•Äâä+1îïñó
    òbèqôöõòPì)ú81ù-+ -/.0011 8û'5
    7)ù-+1
    ~eKleü)†Ç•Ä@°V81
    ¢"2 20
    #£§[D•gh+¶uF% 231% 8û'5Åß1efè®
    ©+™´¨ì
    +≠$ +4-11 Æ#gh[1
    ÅØ8•% 04.11%
    Æ#)£§=∞7&5•Äâä+1±≤≥¥=~eµ¥)
    ∂∑@Å∏&'AH$π0∫?Dû'5
    ef≤)^Sªº
    ΩN$+æø¿)¡O¬O£mõΩ√èiXƒ#% +31ì
    2π0∫?MvD≈01
    •Äâä)!≤≥¥@)•Ä£§
    =∆«T[DE'57)ÖÜá$A01•Äâä$%&'
    ef)gh2Ç»t$… 84D1
    lemn=ef2gÀ
    LÃÕ?le=~e$Œk?'7@81
    ]O^_`Oab
    2yz84'5%
    %
    œã[L@7–1
    —]O^_`Oabcd+“”‘0$
    c’[DE'7@2÷◊84L21
    ÿŸ/'⁄Ω^¤‹+
    84/E7@2ICL5
    ≈6M.1
    ¢"£§$›E~e5®
    ©fifl¡Sqb6‡·2£§[D‚∑•Ä2£§&'7@
    %
    !3#4567869:12;<=>
    ,?@ABCD0E45FGH&
    %
    !"#$%&'()*
    +,(($(
    -(,.'()**+,(($(
    !"#$ %&'&()*+,
    24

    View full-size slide

  25. hardware block diagram
    psz117
    Publications of the Astronomical Society of Japan (2019), Vol. 71, No. 6 118-9
    Fig. 7. Hardware block diagram of OAOWFC, which consists of 15 subsystems with communication capabilities; rounded rectangles with light-gray
    background show the subsystems, and strings at the upper-left corner describe their role. The structure is composed of three columns: network-
    attached PC/appliance, the controller, and the devices, arranged from left to right. TS stands for the terminal server, a Linux-based appliance used
    to convert messages from serial to TCP/IP or vice versa. PDU stands for the power distribution unit, arranged to restart a subsystem remotely if an
    Downloaded from https://academic.oup.com/pasj/article-abstract/71/6/118/5613951 by National As
    25

    View full-size slide

  26. hardware block diagram
    psz117
    Publications of the Astronomical Society of Japan (2019), Vol. 71, No. 6 118-9
    Fig. 7. Hardware block diagram of OAOWFC, which consists of 15 subsystems with communication capabilities; rounded rectangles with light-gray
    background show the subsystems, and strings at the upper-left corner describe their role. The structure is composed of three columns: network-
    attached PC/appliance, the controller, and the devices, arranged from left to right. TS stands for the terminal server, a Linux-based appliance used
    to convert messages from serial to TCP/IP or vice versa. PDU stands for the power distribution unit, arranged to restart a subsystem remotely if an
    Downloaded from https://academic.oup.com/pasj/article-abstract/71/6/118/5613951 by National As
    26

    View full-size slide

  27. hardware block diagram
    psz117
    Publications of the Astronomical Society of Japan (2019), Vol. 71, No. 6 118-9
    Fig. 7. Hardware block diagram of OAOWFC, which consists of 15 subsystems with communication capabilities; rounded rectangles with light-gray
    background show the subsystems, and strings at the upper-left corner describe their role. The structure is composed of three columns: network-
    attached PC/appliance, the controller, and the devices, arranged from left to right. TS stands for the terminal server, a Linux-based appliance used
    to convert messages from serial to TCP/IP or vice versa. PDU stands for the power distribution unit, arranged to restart a subsystem remotely if an
    Downloaded from https://academic.oup.com/pasj/article-abstract/71/6/118/5613951 by National As
    27

    View full-size slide

  28. hardware block diagram
    psz117
    Publications of the Astronomical Society of Japan (2019), Vol. 71, No. 6 118-9
    Fig. 7. Hardware block diagram of OAOWFC, which consists of 15 subsystems with communication capabilities; rounded rectangles with light-gray
    background show the subsystems, and strings at the upper-left corner describe their role. The structure is composed of three columns: network-
    attached PC/appliance, the controller, and the devices, arranged from left to right. TS stands for the terminal server, a Linux-based appliance used
    to convert messages from serial to TCP/IP or vice versa. PDU stands for the power distribution unit, arranged to restart a subsystem remotely if an
    Downloaded from https://academic.oup.com/pasj/article-abstract/71/6/118/5613951 by National As
    28

    View full-size slide

  29. software block diagram
    psz117
    29

    View full-size slide

  30. software block diagram
    psz117
    30

    View full-size slide

  31. software block diagram
    psz117
    31

    View full-size slide

  32. software block diagram
    psz117
    32

    View full-size slide

  33. software block diagram
    psz117
    33

    View full-size slide

  34. software block diagram
    psz117
    34

    View full-size slide

  35. Rinda (again)
    write, read, take
    35

    View full-size slide

  36. concern
    ނো΍௨৴ΤϥʔͰ΋͏·͍͘͘ʁ
    In the real world the device will fail
    36

    View full-size slide

  37. design
    tuple with tiemout
    use notify instead of take
    37

    View full-size slide

  38. weather monitor (again)
    weather monitor writes a Tsky tuple every minute.
    tuples live for 2 minutes
    Control daemon waits with notify()
    Normally, there are 1-2 Tsky tuples
    38

    View full-size slide

  39. Yanagisawa said.
    Proceedings of Symposium on Engineering in Astronomy 2017
    39

    View full-size slide

  40. Tochigi RubyKaigi 09
    2020-09-12
    ͖ͭͮ͸TochigiͰ
    40

    View full-size slide