- up: ð䞊è¡ããã°ã©ãã³ã°
- refs.
- links
ðã¡ãã»ãŒãžããã·ã³ã°ã¢ãã« - Message Passing Model
Message-passing concurrency, ã¡ãã»ãŒãžäŒé䞊è¡æ§
ã¡ãã»ãŒãžããã·ã³ã°ã¢ãã«ãšãã®ããã°ã©ãã³ã°ææ³.
ãããã®æ€çŽ¢çµæã§ã¯ã¡ãã»ãŒãžããã·ã³ã°ãããåŒã£ãããã®ã§ãããæ¡çš. ðCTMCPã®4ç« ã§ã¯ã¡ãã»ãŒãžäŒéã¢ãã«.
ããŒã¿ã端æ«(ã¢ã¯ã¿ãŒ, ããã»ã¹, ã¹ã¬ãã)ã«éä¿¡ãã.
ðã¡ãã»ãŒãžããã·ã³ã°
ð䞊è¡ããã°ã©ãã³ã°ãðãªããžã§ã¯ãæåããã°ã©ãã³ã°ãããã»ã¹ééä¿¡ã§ã¡ãã»ãŒãž(é åºã¥ããããæåå)ãããåãããããã®éä¿¡æ¹åŒ.
RMI, ã·ã°ãã«, ããŒã¿ãã±ããâŠ
ðéä¿¡ãããã³ã«(Communication Protocol)ã®èšãæããšãã£ãŠããã.
èæ ®ãã¹ã芳ç¹ã¯ããããã§ããç®çã«å¿ããŠéžæ.
- åæ/éåæ
- éä¿¡çžæ
- äžå¯Ÿäž
- å€å¯Ÿäž(ã¯ã©ã€ã¢ã³ããµãŒã)
- äžå¯Ÿå€(ãã«ããã£ã¹ã)
- é åºä¿èšŒ
- 誀ãèšæ£
ðåæéä¿¡ãšéåæéä¿¡
åæ/éåæéä¿¡åã³ã®ãã®ããã°ã©ãã³ã°æ¹æ³.
ðåæéä¿¡
Syncronious, syncronized,
éä¿¡è ãšåä¿¡è ããäºãã«ã¡ãã»ãŒãžã®è»¢éãåŸ ã€. éä¿¡è ã¯åä¿¡è ãã¡ãã»ãŒãžãåä¿¡ãããŸã§ããã°ã©ã ãåéã§ããªã.
ã¡ãªããã¯ããã°ã©ã ã(éåæã«æ¯ã¹ãŠ)åçŽã«ãªã. ãŸããããã¡ãå¿ èŠãšããªãããšã§ã¡ã¢ãªå¹çã¯ãã.
ãã¡ãªããã¯åŸ ã€ããšããæé, æéå¹çã¯æªã.
ðéåæéä¿¡
Asyncronious. asyncãšããšç¥ããã.
èªã¿æ¹æ³šæ. ei or ae. ãšãŒã·ã³ã¯ãšèªé ã䌞ã°ã. ã¢ã·ã³ã¯ã§ã¯ãªã. æ¥ããããã€ã³ã.
ã¡ãªããã¯éä¿¡è ã¯åä¿¡è ãã¡ãã»ãŒãžãåãåããŸã§åŸ ã€å¿ èŠã¯ãªã. æéå¹çã¯ãã. ãããã¡ãã€ããã®ã§, ãããã¡ã®ãµã€ãºãèšå®ããŠ, ããã溢ãããéä¿¡è ããããã¯ããããã®åŸã®ã¡ãã»ãŒãžãåãæšãŠãå¿ èŠããã.
ð¡äžŠè¡äžŠåãšéåæã®éã
ããã¹ã¬ãããšéåæãåãã³ã³ããã¹ãã§ç»å Žããã, å¥ã®æŠå¿µ.
ã¹ã¬ããã¯ç«¯æ«ã§ãã, éåæéä¿¡ã¯ãããã³ã«.
ãµãŒããšãããã¯ãŒã¯ãããã®éãããããã®ã®, ãµãŒãããããã¯ãŒã¯ãã¢ããªããã¢ã¯ã»ã¹ãããšãã«äž¡æ¹çµç±ãããããªæãã§, ã³ãã¥ãã±ãŒã·ã§ã³ãéæãããšãã芳ç¹ã§ããã°ã»ããã§ç»å Žããã®ãçŽåŸ.
ð€ãšã©ãŒãªã«ããªãŒã¯åæéä¿¡
ã·ã¹ãã ã«ãããç·æ¥äºæ ã«ãããŠ, ãšã©ãŒãªã«ããªãŒã®åŠçãæåªå ã«ãªã, ã¹ã¬ãããæ¡ã£ãŠä»ã®ããã»ã¹ã«æž¡ããªãããã«ã¯éåæéä¿¡ãããåæéä¿¡ã§è¡ãã®ããã.
ð€é»è©±ã¯åæéä¿¡ã§ã¡ãŒã«ã¯éåæéä¿¡
ããªãšã¢ã³ãæ¿æãããã€.
人éãã¢ã¯ã¿ãŒãšãããªãã°, é»è©±ã¯çžæã®æéãããããã³ã°ãã. ã¡ãŒã«ã¯ãªã¢ã«ã¿ã€ã ã«ããåãããå¿ èŠã¯ãªã.
é»è©±ã¯åæéä¿¡ã®ãããã³ã«ã§ãã, ã¡ãŒã«ã¯éåæéä¿¡ã®ãããã³ã«.
ãããã身è¿ãªäŸã§æ å ±æè¡ãç解ããããšã¯å€§äºãªæ°ããã. ä»äººãžã®èª¬æã®äŸã§ã䜿ãããã.
ðActor ã¢ãã«
è€æ°ã®ã¹ã¬ãããéä¿¡ã®ããã«ã¡ãã»ãŒãžãããããã.
Scala ã Erlang ã§æ¡çšãããŠããæ¹æ³.
æçŽãéãåããããªæ¯å©ã䜿ããã.
Functinal Reactive Programming
ããå€åã«å¿ããŠåäœãã, ã€ãã³ãé§åã®ããã°ã©ãã³ã°æ¹æ³.
Reactive Programmig ã«ã¯, 2 ã€ã®çš®é¡ãããããã .(æµ æµ·ããã®ãã¬ãŒã³ãã)
- Actor Model
- Monadic Model
以äžã®èšäºããããããã.
- Q. (é¢æ°å) ãªã¢ã¯ãã£ãããã°ã©ãã³ã°ãšã¯äœã§ãã? | POSTD
- ã翻蚳ãããªããæ±ããŠãããªã¢ã¯ãã£ãããã°ã©ãã³ã°å ¥é - ninjinkunâs diary
GUI, ã€ã³ãã©, ããã°ããŒã¿åŠçãªã©æ§ã ãªå Žé¢ã§æµžéãã€ã€ãããŸã. ä»ãŸã§ã¯è€éãããŠäœãããšãé£ããã£ãã¢ããªã±ãŒã·ã§ã³ãç°¡åã«èšèšã§ããããã«ãªã£ãŠããã§ããã.
æéãšãšãã«å€åããâå€ãè¡šãããŒã¿å.
FRP ã¯éåæããŒã¿ã¹ããªãŒã ãçšããããã°ã©ãã³ã°ã§ãã ( FRP is programming with asynchronous data streams)
ã·ã°ãã«
ã·ã°ãã«ãšã¯, æéãšãšãã«å€åããå€. ãã®ã·ã°ãã«ãæ±ã£ãŠã€ãã³ããåŠçããæ¹æ³.
ã·ã°ãã«ã«ã¯ä»¥äžã®é¢åãã¿ã責åããã.
- çŸåšã®å€
- çŸåšã®å€ã«å¯Ÿå¿ããè©äŸ¡
- ãã®å€ã«äŸåããä»ã®ã·ã°ãã« (Observers)
ãªã¢ã¯ãã£ãæ§
ref. 2015 幎ã«åããŠç¥ã£ãŠãããããªã¢ã¯ãã£ãã¢ãŒããã¯ãã£ã®æœ®æµ - Qiita
ãªã¢ã¯ãã£ããšäžèšã§èšã£ãæã«, çŸç¶ã§ã¯ 2 ã€ã®å«æããããŸã.
- ã¢ãŒããã¯ãã£ã®åèŠçŽ ãã¡ãã»ãŒãžé§åã§ã€ãªã, åå¿çã«å€åãããããš.
- ã¡ãã»ãŒãžã®éåä¿¡ãé èœãå€å士ã®é¢ä¿ (data-flow) ã宣èšç (é¢æ°åç) ã«èšè¿°ããããã°ã©ãã³ã°ãã©ãã€ã
å€æ° a, b ã«ã€ããŠ, 以äžã®ããã«æ å ±ãæŽæ°ãããšã,
- a = 3
- b = 2 + a
- a = 1
æçµçã«ã¯, a = 1, b = 3 ã«ãªãããã«ãã. æé 3 ã§, a ã®æŽæ°ã«å¯Ÿã㊠b ãæŽæ°ããããšããããªã¢ã¯ãã£ã.
ãªã¢ã¯ãã£ã宣èš
ãªã¢ã¯ãã£ã宣èšãªããšãã, ãã£ãããæç« ãååšãã.
4 ã€ã®ååããã
- Responsive:å³æå¿çãã
- Elastic:䌞瞮èªåšã§ãã
- Message Driven:ã¡ãã»ãŒãžé§åã§ãã
- Resilient:å埩åããã
Related
ðCSPã¢ãã«
Communicating Sequential Processes.
GoãClojureã§æ¡çšãããŠããæ¹æ³.
ããã»ã¹ä»£æ°
æ·±ãæ å ±ãçµããŠããªããCSPã«ã€ããŠèª¿ã¹ãŠãããWikipediaã®ããã»ã¹ä»£æ°ã«ãã©ãçããã®ã§ã¡ã¢. ãã®çè«ãèæ¯ã«ãã.
ð¡ã¯ã€ãã¯ãœãŒãã®äººãèæ¡
èæ¡ããã¢ã³ãããŒã»ããŒã¢ããã¯ãªããšã¯ã€ãã¯ãœãŒãã®çºæè .
Axiomatic semantics: å ¬ççæå³è«ããã®äººãšã.