ãã®èšäºã¯ãC ++ CoreHard Autumn 2017ã«ã³ãã¡ã¬ã³ã¹ã®ååã®ã¬ããŒãã®ããã¹ããæ¹äœãããã®ã§ãã ãã®èšäºã¯ãåºçç©ã ã¢ã¯ã¿ãŒãšC ++ã®ã¢ãã«ïŒäœããªããã©ã®ããã«ã§ããïŒ ãããã³ããã³ããC ++ã§ã¢ã¯ã¿ãŒã䜿çšããŠ15幎以äžè©°ã蟌ãã ã ããŒãIããã³ããŒãIIã§å ã«åãäžãããããã¯ã®å®äºãšèŠãªãããŸãã ä»æ¥ã¯ããããžã§ã¯ãã§ã¢ã¯ã¿ãŒã®ã¢ãã«ãæ£åžžã«äœ¿çšã§ããããšãç解ããæ¹æ³ã«ã€ããŠèª¬æããŸãã
ååãšããŠãèšäºã¯ããã£ããã³ãã§ãã ããã«èšè¿°ãããŠãããã®ã¯éåžžã«æçœã§ãããéåžžã®åžžèã«ãã£ãŠæ±ºå®ãããŸãã ããããæ®å¿µãªããããããã«æ£ç¢ºã«æ³šæãéäžããããšã¯ããŸããããŸããã
ã俳åªãšC ++ã®ã¢ãã«ïŒç¥è©±ãçŸå®ãïŒããšãããããã¯ã«é¢ããåæ çãªäœè«
ãã®èšäºã§ã¯ãç¹å®ã®ããã°ã©ãã³ã°èšèªã«é¢ä¿ãªããã¢ã¯ã¿ãŒã¢ãã«èªäœã«åºæã®äºé ã«ã€ããŠèª¬æããŸãã ãããããªããªã èè ã¯ãC ++ã§ã®ãœãããŠã§ã¢ã®éçºãã€ãŸãC ++ã§ã®ã¢ã¯ã¿ãŒã®é©çšå¯èœæ§ã«ããçšåºŠéç¹ã眮ããŠããŸãã
Erlangããã°ã©ãã³ã°èšèªãŸãã¯Akkaãã¬ãŒã ã¯ãŒã¯ã®äœ¿çšæ¹æ³ã«ã€ããŠã¯ãã€ã³ã¿ãŒãããäžã«å€ãã®æ å ±ããããŸãã ããããã¢ã¯ã¿ãŒã®ã¢ãã«ãC ++ã§ã©ã®ããã«äœ¿çšããããã«ã€ããŠã®æ å ±ã¯ã»ãšãã©ãããŸããã ãããŠãã¢ã¯ã¿ãŒã®ã¢ãã«ãšC ++ã¯åºæ¬çã«äºææ§ããªãããã«æããããããããŸããã
ããã§ã¯ãããŸããã ã¢ã¯ã¿ãŒã¢ãã«ã¯C ++ã§æ£åžžã«é©çšã§ããŸãã ãããŠãããã¯å žåçã§ãããããã§ãé©çšãããŸãã C ++ã§ã¢ã¯ã¿ãŒã¢ãã«ã䜿çšããäŸãç¥ã£ãŠããã¢ããªã±ãŒã·ã§ã³é åã®çããªã¹ãã次ã«ç€ºããŸãã
- ç£æ¥ãªãŒãã¡ãŒã·ã§ã³ïŒACS TPïŒ;
- ãã¬ã³ã
- é»ååååŒããã³ã¢ãã€ã«åååŒã
- ã·ãã¥ã¬ãŒã·ã§ã³ã¢ããªã³ã°;
- CAD
- ã²ãŒã æ§ç¯;
- ããã«ãŠã§ã¢ïŒDBMSã...ïŒ
C ++çšã®æ¢è£œã®æŽ»çºã§éçºäžã®ãã¬ãŒã ã¯ãŒã¯ãããã€ããããŸãããæãæåãªãã®ã¯æ¬¡ã®ãšããã§ãã
- QP / C ++ ïŒãã¥ã¢ã«ã©ã€ã»ã³ã¹ïŒ;
- Just :: Thread ProïŒActors Edition ïŒåçšã©ã€ã»ã³ã¹ïŒ;
- C ++ã¢ã¯ã¿ãŒãã¬ãŒã ã¯ãŒã¯ ïŒBSD-3-Clauseã©ã€ã»ã³ã¹ïŒ;
- SObjectizer ïŒBSD-3-Clauseã©ã€ã»ã³ã¹ïŒã
ããã«ïŒ
- OOSMOS ïŒãã¥ã¢ã«ã©ã€ã»ã³ã¹ãCèšèªãC ++ã§ã䜿çšå¯èœïŒ;
- éåæãšãŒãžã§ã³ãã©ã€ãã©ãª ïŒVisual Studioã«å«ãŸããŠããŸãïŒ;
ååãšããŠãéžæè¢ã¯ãããããããŸãã èªè»¢è»ãæžãå¿ èŠãããããŸããã ç§ãã¡C ++ããã°ã©ããŒã¯æ¬åœã«æ°ã«å ¥ã£ãŠããŸãã ãã ãããããã®ãã¬ãŒã ã¯ãŒã¯ã®1ã€ã®å€ãéçºè ãšããŠã2ã€ã®ããšãèšãããšãã§ããŸãã
- ãŸããã¢ã¯ã¿ãŒã®ã¢ãã«ã¯C ++ã§å®å šã«äœ¿çšã§ããŸãã è¯å®çãªçµæããããããŸãã å®éã«ç¹°ãè¿ããã¹ããããŠããŸãã
- 第äºã«ãã¢ã¯ã¿ãŒã¢ãã«ã®C ++ã®å®è£ ãè¡ãããšã¯ããããããä»äºã§ãã åŽåãšæéã¯å€ããæè³ããå¿ èŠããããŸãã ãããŠããããäžæçãŸãã¯é·æçã«å®æžãããã©ããã¯äžæã§ãããã»ãšãã©ã®å Žåãå®æžããŸããã
ãããã£ãŠãC ++ã§ã¢ã¯ã¿ãŒã¢ãã«ã䜿çšããå Žåã¯ãæåã«äœããè©ŠããŠã¿ãã®ãçã«ããªã£ãŠããŸãã ãããŠãããªãã®ä»äºã«ãµãããããã®ããªãå Žåã«ã®ã¿ãããªãã¯ãã§ã«ããªãã®èªè»¢è»ã«ã€ããŠèããããšãã§ããŸãã ãŸãã¯ãããã°ã©ãã³ã°èšèªã®å€æŽãç ç²ã«ããŠãã§ãã
俳åªã®ã¢ãã«ã«ã€ããŠè©±ãããšã¯äŸ¡å€ããããŸããïŒ
ã¹ããŒãªãŒã®äž»ãªéšåã¯ãã俳åªã®ã¢ãã«ã¯å¿ èŠã§ããïŒããšãã100äžãã«ã®è³ªåããå§ããŸãã
ç¹ã«ããã®åé¡ã¯å°éçãªãªãœãŒã¹ã§çºçããããšããããããŸãã äžçã®ãã¹ãŠãç¥ã£ãŠããããããè¡ãããšãã§ããå¿åã®å°é家ã¯ã圌ããå¿ èŠã§ã¯ãªããšäž»åŒµããŸãã ããããããã®ãããªå·šå€§ãªã¢ã³ã¹ã¿ãŒã¯ãã¢ã¯ã¿ãŒã¢ãã«ã競åããã°ã©ãã³ã°ãžã®ä»ã®ã¢ãããŒããå¿ èŠãšããŸããã ããããç§ã¯ãã®èª¿æ»ã«å¯Ÿããé©åã§ãã©ã³ã¹ã®åããåçã«èå³ããããŸãã
ç§ã®æèŠã§ã¯ãã俳åªã¢ãã«ã¯å¿ èŠã§ããïŒããšãã質åã¯ããF1é«ééè·¯ã§ãã³ããã©ãã¯ãå¿ èŠã§ããïŒããšãã質åã«éåžžã«äŒŒãŠããŸãã
äžçªäžã®è¡ã¯ã1ã€ãš2çªç®ã®è³ªåã®äž¡æ¹ã1ã€ã®éèŠãªæ確åãªãã§ã¯ç¡æå³ã§ãããšããããšã§ã...ããªãã¡ïŒã äœã®ããã«ïŒ ã
ãF1é«ééè·¯ã«ãã³ããã©ãã¯ãå¿ èŠãªã®ã¯ãªãã§ããããšãã質åããããšãéåžžã®åçã®ããã®æå³ã®ããã¹ããŒã¹ãããã«åŸãããŸãã ããšãã°ãF1ãã©ãã¯ã®ãã©ãã¯ã修埩ããŸãã ããã«ã¯ãã³ããã©ãã¯ãå¿ èŠã§ããïŒ ããããããã§ãã ãããŠè³ªåã¯çã«ããªã£ãŠãããããã«å¯Ÿããéåžžã®çãããããŸãã
åæ§ã«ãã¢ã¯ã¿ãŒã¢ãã«ãå¿ èŠã§ãã ããã®ãããªç¶æ³ã§ã¢ã¯ã¿ãŒã®ã¢ãã«ãå¿ èŠãªçç±ããšãã質åããããšããã«ãæå³ã®ããçããèŠã€ããæ©äŒãããã«åŸãããŸãã
ãããŠããã®çãã¯ãã°ãã°ïŒããªãã®äººçãç°¡çŽ åããããã«ïŒ
ããã...
ãã ãããã¹ãŠãããã»ã©åçŽã§ã¯ãããŸããã ãããªãã¯ãã¡ãããåè«ã ãããã§ã€ãã³ããïŒããšããæ¬ãèªãã§ãããããããŸããããªãã£ãŒãã»ãã§ã€ãã³ãããªã³ã¹ãã³ç 究æã§ããã¡ãã®å®éšãã©ã®ããã«è©Šã¿ãã®ããšãã話ãããã倧ããªããã«ã®æ°ŽãççºãããŸããã 以åã®éèŠãªå®éšã®çµæãå«ãåçã¯å°ç¡ãã«ãããŸããã ãã®åŸãç 究æã®é·ã¯ãã§ã€ãã³ã«æ¬¡ã®ããã«èªã£ãããåå¿è ã®å®éšã¯åå¿è ã®å®éšå®€ã§è¡ãã¹ãã§ãïŒã
ãããŠããããã®åãèšèã¯ã誰ãä»ãŸã§èª°ãåãçµãã ããšã®ãªãå®éã®ãããžã§ã¯ãã«ãã¯ãããžãŒããã©ãã°ããããã¹ãŠã®äººã«åããããŸãã
åºæ¬çã«ãç§ãã¡ã¯ããã倧奜ãã§ãã HDDãšããçšèªãããããŸã-èªå€§åºåé§åéçºã äœãæ°ããããšãåŠãã ãšããç§ãã¡ã¯ã€ã³ã¹ãã¬ãŒã·ã§ã³ãåããæŠéãããžã§ã¯ãã«åŒããã蟌ãŸãããã®çµæãšã®é·ãæç¶çãªéãã®ããã«ã
ãã®ãããã¢ã¯ã¿ãŒã¢ãã«ã倧èŠæš¡ãªãããžã§ã¯ãã§èãé£ãçã¿ãåŒãèµ·ãããªãããã«ããã«ã¯ãæåã«ç·Žç¿ããå¿ èŠããããŸãã ããšãã°ãç«ã®å Žå:)
ç«ãèšç·Žããå¿ èŠããããŸãïŒ
æåã«ãå°ããªããã¡ãã®ããºã«ã§ã¢ãã«ã¢ã¯ã¿ãŒãè©ŠããŠãã ããã ã¢ã¯ã¿ãŒãäœæããã¢ã¯ã¿ãŒéã§ã¡ãã»ãŒãžãéä¿¡ããŸãã æ°ã«å ¥ã£ãå Žæãæ°ã«å ¥ããªãã£ãå Žæã確èªããŸãã ãªãæ°ã«å ¥ããªãã£ãã®ãèããŠã¿ãŠãã ããã
éåžžã«å€ãã®å Žåãã¢ã¯ã¿ãŒãšã®äœæ¥ã®éå§æã«ã人ã ã¯ã¡ãã»ãŒãžãä¹±çšããŸãã ãããã¯ãã¢ã¯ã¿ãŒã®åœ¢åŒã§ããã°ã©ã å ã®ãšã³ãã£ãã£ãè¡šçŸããããšããéåæã¡ãã»ãŒãžãä»ãããšã³ãã£ãã£éã®çžäºäœçšãè¡šçŸããŸãã ããããããã¯åžžã«ããŸããããšã¯éããŸããã éåæã¡ãã»ãŒãžã®å©ç¹ãéåæã¡ãã»ãŒãžã®æ¬ ç¹ã«å€ããå§ãããšããç§ãã¡èªèº«ã®çµéšã§ãã®åŽé¢ãçµéšããå¿ èŠããããŸãã
ãã®è¡ããŸã èŠã€ããŠããªãå Žåãã¢ã¯ã¿ãŒã¢ãã«ãå®éã®å€§èŠæš¡ãããžã§ã¯ãã«ãã©ãã°ãããšãäžèŠãªã¡ãã»ãŒãžã亀æããã¢ã¯ã¿ãŒãè¿œå äœæããå¯èœæ§ããããŸãã ããã¯äœåãªé çã®çš®ã«ãªããã³ãŒãã«åé¡ãåŒãèµ·ãããŸãã
äžè¬ã«ããã¹ãŠãé©åºŠã«åªããŠããããã®å¯Ÿçã¯æŠéãããžã§ã¯ããããããã¡ãã®ããºã«ã§èŠã€ããæ¹ãè¯ãã§ãã
äžçãèŠãæ¹æ³ãšããŠã®ä¿³åªã¢ãã«
ã¢ã¯ã¿ãŒã®ã¢ãã«ãåãäžãããšããã¢ã¯ã¿ãŒã®ã¢ãã«ã¯ããã°ã©ã å ã®ãšã³ãã£ãã£éã®çžäºäœçšãæŽçããæ¹æ³ã«éããªãããšãç解ããå¿ èŠããããŸãã ãŸããã¿ã¹ã¯åæããã³èšèšææ³ãžã®ã¢ãããŒãã§ãã
ãªããžã§ã¯ãæåã¢ãããŒããšã®é¡äŒŒæ§ãåŒãåºãã®ãé©åã§ãã 25幎ãŸãã¯30幎åã3ã€ã®ã·ã³ãã«ãªååãåãããªããžã§ã¯ãã¢ãããŒãã¯ãçã®ãã¬ãŒã¯ã¹ã«ãŒã§ããã 倧èŠæš¡ãªãœãããŠã§ã¢ã·ã¹ãã åãã®ã³ãŒãã®èšè¿°ãç°¡çŽ åããã ãã§ãªããç»æçãªè£œåã§ãã ããããæãéèŠãªããšã¯ããªããžã§ã¯ãã¢ãããŒããããããã®æ倧ã®ãœãããŠã§ã¢ã·ã¹ãã ã®åæãšèšèšãå€§å¹ ã«ç°¡çŽ åããããŒã«ã«ãªã£ãããšã§ãã
ãªããžã§ã¯ãã¢ãããŒãã®åçã«ããã察象é åãç°ãªãç®ã§èŠãããšãã§ããŸããã 人ã ã¯ã察象é åã®ãªããžã§ã¯ããåé¡ããç¹å¥ãªæ¹æ³ã§åŠã³ãŸããã ããã«ãããããã°ã©ã å ã§ãªããžã§ã¯ããããç°¡åã«å®è£ ã§ããããã«ãªããŸããã
ããã¯ã人ã ã«ã¢ã¯ã¿ãŒã®ã¢ãã«ã䜿çšããã®ã«äŒŒããã®ã§ãã 圌女èªèº«ã¯ã3ã€ã®ç°¡åãªååã«åºã¥ããŠããŸãã
- ã¢ã¯ã¿ãŒã¯æ¯ãèããæã€ãšã³ãã£ãã£ã§ãã
- ã¢ã¯ã¿ãŒã¯çä¿¡ã¡ãã»ãŒãžã«å¿çããŸãã
- ã¡ãã»ãŒãžãåä¿¡ãããšãã¢ã¯ã¿ãŒã¯æ¬¡ã®ããšãã§ããŸãã
- ç¹å®ã®æ°ã®ã¡ãã»ãŒãžãä»ã®ã¢ã¯ã¿ãŒã«éä¿¡ããŸãã
- å€æ°ã®æ°ããã¢ã¯ã¿ãŒãäœæããŸãã
- åŸç¶ã®ã¡ãã»ãŒãžãåŠçããããã®æ°ããåäœãå®çŸ©ããŸãã
ãããããããã®ååã¯ããŸã第äžã«ãéçºè ã«åœŒãã®äž»é¡åéãç°ãªã£ãŠèŠãæ¹æ³ãäžããŸãã ã¢ã¯ã¿ãŒã®ã¢ãã«ã䜿çšãããšãããã€ãã®ããããã£ãæã€ãªããžã§ã¯ãã ãã§ãªãããµããžã§ã¯ããšãªã¢ã«è¡šç€ºããå§ããŸãã ç¬èªã®æ¯ãèããæã€ãªããžã§ã¯ããèŠãå§ããŸãã ãŸãããããã®ãªããžã§ã¯ããšä»ã®åããªããžã§ã¯ããšã®éä¿¡æ¹æ³ã
察象é åèªäœã§ä¿³åªãæ€åºããããšãæåã«åŠã¶ããšãããããŸãã ãããŠããããã®ã¢ã¯ã¿ãŒãã³ãŒãå ã®ãªããžã§ã¯ãã«ã·ãŒã ã¬ã¹ã«è»¢éããæ©äŒãåŸãŸãã
ãããŠãããããŸãã«ã¢ã¯ã¿ãŒã¢ãã«ã®äŸ¡å€ã®ãããã®ã§ãããµããžã§ã¯ãé åãšãœãããŠã§ã¢å®è£ ã®äž¡æ¹ã«é¢ããŠãåãæŠå¿µã§éçšããæ©äŒããããŸãã
ã³ã€ã³ã®è£åŽ
äžéšã®ãµããžã§ã¯ããšãªã¢ãèŠãããšãã§ããŸãããããã«ãã俳åªã¯ãŸã£ããèŠããŸããã
å žåçãªäŸïŒèšç®æ°åŠã 俳åªã®åœ¢ã§è¡šçŸãããã®ã¯å®è³ªçã«ãããŸããã ãã¡ãããè©Šãããšã¯ã§ããŸãããæå³ããããŸããã ããšãã°ãã¢ã¯ã¿ãŒãããªãã¯ã¹ãšã¢ã¯ã¿ãŒãã¯ãã«ãäœæã§ããŸãã ãããŠããã¯ã¿ãŒã¯ãèªåãæããŠãã ããããšããã¡ãã»ãŒãžããããªãã¯ã¹ã«éä¿¡ããŸãã ããããããã¯ããªãæãã«èãããŸãã
æ°åŠçèšç®ã䞊ååãããšã俳åªã®ããã«èŠããããšããããŸãã ããã§ã¯ã䞊ååãšçµæã®åéãè¡ããšã³ãã£ãã£ãçºçããŸãã ãããã®ãšã³ãã£ãã£ã¯ãã¢ã¯ã¿ãŒã«äŒŒãŠããå ŽåããããŸãã ãããã圌ãã俳åªã«ããããšã¯æçã§ãããšããäºå®ããã¯ã»ã©é ãã map-reduceãŸãã¯ã¿ã¹ã¯ããŒã¹ã®äžŠååŠçã䜿çšããæ¹ãç°¡åãªå ŽåããããŸãã
ãã®ããã俳åªã®ã¢ãã«ã䜿çšããŠãããŒãã¹ãããããããªãã ãã§ãªããç§ãã¡ã®ç掻ãè€éã«ãªãå¯èœæ§ã®ãããµããžã§ã¯ãé åããããŸãã ãã®ãããªé åã§ã¯ãã¢ã¯ã¿ãŒã®ã¢ãã«ã䜿çšããæå³ããããŸããã ãããŠãããªãããã®ãããªãšãªã¢ãæã£ãŠãããªããããªãã¯ãã ãã³ããã©ãã¯ãå¿ èŠãšããŸãããããããã¹ãŠã§ãã
ãªããã¹è«æ
ããã€ãã®ããŒã«ãŒãèŠãŠã¿ãŸããããããŒã«ãŒãããã°ãã¿ã¹ã¯å ã®ã¢ã¯ã¿ãŒã®ã¢ãã«ãæ ¹ä»ãããšãããããŸãã
ç§ã¯ããã«èšããªããã°ãªããŸããïŒãããã®ããŒã«ãŒã¯å¿ èŠã§ãããäœãä¿èšŒããŸããã ãã ãããµããžã§ã¯ããšãªã¢å ã®ããŒã«ãŒãå€ãã»ã©ãã¢ã¯ã¿ãŒã¢ãã«ãäœæ¥ãç°¡çŽ åããå¯èœæ§ãé«ããªããŸãã
ç«ãšå¿ãã®åå
æåã®ããŒã«ãŒã¯ãéä¿¡ãšå¿åŽã®ååã䜿çšããæ©èœã§ãã
ãã®ååã¯äœã§ããïŒ
ãŸããã¿ã¹ã¯ã®äœæ¥ã®é²è¡ãå¶åŸ¡ããå¿ èŠã¯ããŸããªããšããäºå®ã§ãã é©åãªæéãšãªãœãŒã¹ãèŠã€ãã£ããšãã«ãã¹ãŠãè¡ãããŸãã ããªãã¯èªåã®åœ¹å²ãæãããããªãã®ä»äºã®çµæãããã«ã©ããã«äŒããã°ããããã®çµæã«äœãèµ·ãããèå³ããªããªããŸãã
第äºã«ããã®ååã¯ãã»ãšãã©ã®å Žåãããã§éå§ãããæäœã®çµæãç¥ãå¿ èŠããªããšããããšã§ãã äœããå¿ èŠãªå Žåã¯ãã¢ããªã±ãŒã·ã§ã³ãã©ããã«éä¿¡ãããšãã¢ããªã±ãŒã·ã§ã³ã®åŠççµæãåŸ ããã«äœæ¥ãç¶è¡ã§ããŸãã
第äžã«ããã®ååã¯ãäœãããŸã£ããè¡ãããªããã°ãããã§äœãæªãããšã¯ãããŸããã çµæã®æ¬ åŠãç¡èŠãããããã°ããããŠããæäœãç¹°ãè¿ãããšãã§ããŸãã
äžè¬ã«ãããã¯ç§ãã¡ãæ¥åžžç掻ã§å®æçã«äœ¿çšããåçŽã§æçœãªååã§ãã è€éã§éèŠãªã¿ã¹ã¯ã®è§£æ±ºãå«ã¿ãŸãã
ããšãã°ãC ++éçºè åãã®äŒè°ãéå¬ãããšããŸãã èå³æ·±ãã¹ããŒã«ãŒãæåŸ ããå¿ èŠããããŸãã ããªããèŠãã人ã®ãªã¹ããäœããåå ã®å¯èœæ§ã«ã€ããŠå°ããæçŽãéã£ãŠãã ããã æçŽã¯ãªããªããŸãããããã«è¿äºãåŸ ã€å¿ èŠã¯ãããŸããã 人ã ãèããéããä»ã®çµç¹ã®åé¡ã«å¯ŸåŠã§ããŸãã 誰ããããªãã®è³ªåã«ãŸã£ããçããŠããªãå Žåã¯ãããäžåºŠå°ããããšãã§ããŸãã ãŸãã¯ãåã«ãã®äººãåå ããããªãã圌ã«é Œããªãããšãèæ ®ããŠãã ããã
ããªãã¡ å®ç掻ã§ã¯ãéä¿¡ãšå¿åŽã®ååãããé©çšããŸãã ããããåãå®ç掻ããããããåžžã«æ©èœãããšã¯éããªãããšãããããŸãã å®éãããã°ã©ã ãæžããšããåãããšãèµ·ãããŸãã ã©ããã§éä¿¡ãšæ¶å»ã䜿çšã§ããŸãããã©ããã§ã¯äœ¿çšã§ããŸããã
ããšãã°ã2ã€ã®äœæ¥ã¹ã¬ãããäœæã§ããŸãã æåã¯selectãŸãã¯epollã«ãã³ã°ã¢ããããŸãã èªã¿åãçšã®ããŒã¿ã衚瀺ããããããããèªã¿åãã解æçšã®2çªç®ã®äœæ¥ã¹ã¬ãããæå®ããèªåã§å¥ã®ãœã±ããããããŒã¿ãèªã¿åããŸãã æåã®äœæ¥ã¹ã¬ããã§ã¯ãæ£ç¢ºã«2çªç®ã®äœæ¥ã¹ã¬ããã解æãå®è¡ããã¿ã€ãã³ã°ãšããã®è§£æãæåãããã©ããã¯éèŠã§ã¯ãããŸããã
å¥ã®äŸã ãã©ã³ã¶ã¯ã·ã§ã³ãããŒã¿ããŒã¹ã«ã³ãããããŸãã ã»ãšãã©ã®å Žåãçµæãããã«ããããŸãïŒã³ããããæåãããã©ããã ãŸããã³ãããã®çµæãäžæã§ããéãäœæ¥ãç¶è¡ã§ããå¯èœæ§ã¯äœãã§ãã
äžè¬çã«ãéä¿¡ãšéä¿¡ã®ååãã¿ã¹ã¯ã«ãšã£ãŠéåžžã«èªç¶ã§ããããšãããã£ãå Žåãã¢ã¯ã¿ãŒã¢ãã«ã®ã¿ã¹ã¯ãè©Šãããšãã§ããŸãã ãã ããéå§ããæäœã®çµæãããã«ç¥ãå¿ èŠãããå Žåã¯ãã¢ã¯ã¿ãŒã¢ãã«ãé©åã§ã¯ãªãå¯èœæ§ããããŸãã
ã¹ããŒããã·ã³
次ã«éèŠãªããŒã«ãŒã¯ãæéç¶æ ãã·ã³ãšããŠè¡šãããšãã§ãããšã³ãã£ãã£ã®ãµããžã§ã¯ããšãªã¢å ã®ååšã§ãã
äžè¬ã«ãã¢ã¯ã¿ãŒã®ã¢ãã«ã®ååãèŠããšãå®éã«ã¯ã¢ã¯ã¿ãŒã¯æéç¶æ ãã·ã³ã§ããããšãããããŸãããåçŽã§ã¯ãããŸãã
- ã¢ã¯ã¿ãŒã¯æ¯ãèããæã€ãšã³ãã£ãã£ã§ãã
- ã¢ã¯ã¿ãŒã¯çä¿¡ã¡ãã»ãŒãžã«å¿çããŸãã
- ã¡ãã»ãŒãžãåä¿¡ãããšãã¢ã¯ã¿ãŒã¯æ¬¡ã®ããšãã§ããŸãã
- ç¹å®ã®æ°ã®ã¡ãã»ãŒãžãä»ã®ã¢ã¯ã¿ãŒã«éä¿¡ããŸãã
- å€æ°ã®æ°ããã¢ã¯ã¿ãŒãäœæããŸãã
- åŸç¶ã®ã¡ãã»ãŒãžãåŠçããããã®æ°ããåäœãå®çŸ©ããŸãã
å®éãåã¢ã¯ã¿ãŒã«ã¯ãã¢ã¯ã¿ãŒã次ã®ã¡ãã»ãŒãžãåŠçããæ¹æ³ã決å®ããåäœããããŸãã ã¡ãã»ãŒãžãåŠçããéçšã§ãã¢ã¯ã¿ãŒã¯èªåçšã®æ°ããåäœãéžæã§ããŸãã
ããã¯ã¹ããŒããã·ã³ãšåãã§ãããã·ã³ã®çŸåšã®ç¶æ ã¯ãå ¥åä¿¡å·ã®åŠçæ¹æ³ã決å®ããŸãã ãã·ã³ã®æ°ããç¶æ ã¯ãçŸåšã®ç¶æ ãšçä¿¡ä¿¡å·ã®ã¿ã€ãã«ãã£ãŠæ±ºãŸããŸãã
ãããã£ãŠãæéç¶æ ãã·ã³ãåºã䜿çšãããŠããã¿ã¹ã¯ãã¢ã¯ã¿ãŒã®ã¢ãã«ã«é©åã«é 眮ãããŠããããšã¯é©ãããšã§ã¯ãããŸããã
ãã¹ãŠã®ã¹ããŒããã·ã³ãåçã«åœ¹ç«ã€ããã§ã¯ãããŸãã
ããšãã°ããªã³ã©ã€ã³æ ç»é€šã®Webãµã€ããªã©ãã·ã¹ãã ã«ãã°ã€ã³ãããŠãŒã¶ãŒã®ããã»ã¹ã調æŽãããšã³ãã£ãã£ããããšããŸãã ãã®ãšã³ãã£ãã£ã¯ããŠãŒã¶ãŒåãšãã¹ã¯ãŒããå«ãå ¥åèŠæ±ãåãåãããã®åŸèªèšŒãµãã·ã¹ãã ãèŠæ±ããŸãã èªèšŒãæåãããšã課éãµãã·ã¹ãã ã«ãªã¯ãšã¹ããéä¿¡ããããŠãŒã¶ãŒã®æ®é«ã決å®ãããŸãã 次ã«ãéç¥ãµãã·ã¹ãã ã«å¯ŸããŠèŠæ±ãè¡ããããŠãŒã¶ãŒã®éç¥ã®ãªã¹ããååŸãããŸãã ãã®çµæããŠãŒã¶ãŒã®åæããŒãžã圢æãããçŸåšã®æ®é«ã«é¢ããæ å ±ãšä¿çäžã®éç¥ã®ãªã¹ãã衚瀺ãããŸãã
ãã¹ãŠãã·ã³ãã«ã§æ確ãªããã§ãã ããããäœããæ¥ããããã§ãã
ããããããã§ã¯ã¹ããŒããã·ã³ããŸã£ããå¿ èŠãªãã®ã¯æ¥ããããããšã§ãã å®éãå€éšãµãã·ã¹ãã ãžã®åæåŒã³åºãã䌎ãã¢ã¯ã·ã§ã³ã®åçŽãªç·åœ¢ã·ãŒã±ã³ã¹ããããŸãã
ãã®ãããªã·ãŒã±ã³ã¹ãè¡šçŸããã«ã¯ãéåžžã®ãªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã¹ã¬ããã䜿çšããããšããå§ãããŸãã ãã®ããããµãŒãããŒãã£ã®ãµãã·ã¹ãã ãžã®ååŒã³åºãã¯ãåçŽãªåæåŒã³åºãã§ãã
auto process_login(const login_params & params) -> start_page_data { const auto auth_result = request_auth_service(params); if(auth_result.valid_user()) { const auto balance = request_balance(auth_result.user_token()); const auto pending_messages = request_pending_messages(auth_result.user_token()); return make_start_page_data(auth_result, balance, pending_messages); } else return make_unknown_user_page_data(); }
ãã¡ããããŠãŒã¶ãŒããšã«å¥ã ã®ã¹ã¬ãããäœæãããšã³ã¹ãããããããããããã¹ã±ãŒã©ããªãã£ã«ã¯åé¡ããããŸãã ãããããã¡ã€ããŒãŸãã¯ã³ã«ãŒãã³ã䜿çšããèœåãããã°ããã®åé¡ã¯è§£æ±ºãããŸãã ãã®åŸããã¹ãŠã®ã¢ã¯ã·ã§ã³ã¯ããããã¯åŒã³åºããå éšã«æã€ç·åœ¢ã³ã«ãŒãã³ã®åœ¢åŒã§å®è¡ãããŸãã ãŸããæéç¶æ ãã·ã³ã¯å¿ èŠãããŸããã
ãããã£ãŠãããã°ã©ã å ã®ã¢ã¯ãã£ããã£ã®ã»ãšãã©ãåææäœã®ç·åœ¢ã·ãŒã±ã³ã¹ãšããŠè¡šãããŠããå Žåãã¢ã¯ã¿ãŒã¢ãã«ã¯ã»ãšãã©å¿ èŠãããŸããã ãããŠãCSPãŸãã¯ã¿ã¹ã¯ããŒã¹ã®äžŠååŠçã®æ¹åã®ã©ããã«ç®ãåããå¿ èŠããããŸãã
æ¬åœã«äŸ¿å©ãªæéç¶æ ãã·ã³
ããããã©ã®ãããªå Žåã«æéç¶æ ãã·ã³ã圹ç«ã¡ãŸããïŒ
åç¶æ ã®ããã€ãã®ã¿ã€ãã®å ¥åä¿¡å·
ãŸããåç¬éã«1çš®é¡ã®çä¿¡ä¿¡å·ã§ã¯ãªããããã€ãã®çä¿¡ä¿¡å·ãåŸ ã£ãŠãããšãã§ãã
ãã¢ãã³ããã«ãããã°ã©ã ããå¿ èŠããããšæ³åããŠãã ããã ããã«ã¯ãæ°åã®ä»ãããã¿ã³ãåããŠæŒããšã¢ã¯ãã£ãã«ãªããŸãã ãã®åŸãçªå·ä»ãã®å¥ã®ãã¿ã³ãæŒããããCallããã¿ã³ãæŒããããResetããã¿ã³ãæŒããŠå ¥åããçªå·ããªã»ããããŸãããã¢ã¯ãã£ãç¶æ ã®ãŸãŸã«ãããããã¢ãã³ããã«ãéã¢ã¯ãã£ãã«ããæéã§ãããšããã¿ã€ããŒä¿¡å·ãåŸ ã€ããšãã§ããŸãã
ããã¯ãåç¶æ ã§ããã€ãã®ç°ãªãã¿ã€ãã®ä¿¡å·ã«åå¿ããªããã°ãªããªããšãã§ãããæéç¶æ ãã·ã³ã¯ä»ã®ã¢ãããŒããããå®è£ ãããã·ã³ãã«ã§ç解ããããããšãå€æããå ŽåããããŸãã
éç·åœ¢ç¶æ é·ç§»
第äºã«ãåäœã®ããžãã¯ãéç·åœ¢ã§ããå Žåãæéç¶æ ãã·ã³ã圹ç«ã¡ãŸãã ããªãã¡ ç¶æ S1ããç¶æ S2ã«åãæ¿ããããããS3ã«åãæ¿ããããããå ¥åä¿¡å·ã«å¿ããŠãS1ãŸãã¯S2ã«æ»ãããS4ã«é²ã¿ãããããS2ã«æ»ãããšãã§ããŸãã
ãã®ãããªç¶æ éã®åšæçãªé·ç§»ã®å Žåãç¶æ ãã·ã³ã¯ç·åœ¢ã³ãŒããæžãããã䟿å©ãããããŸããã
é«åºŠãªã¹ããŒããã·ã³
第äžã«ãã¹ããŒããã·ã³ã®é«åºŠãªæ©èœãå¿ èŠã«ãªãå ŽåããããŸãã
- ç¶æ ãžã®åºå ¥ãã«å¯Ÿããåå¿;
- ç¶æ ã®éå±€ïŒãã¹ããããç¶æ ãã€ãã³ãã®ç¶æ¿ïŒ;
- ç¶æ ã®å±¥æŽã
- å·ã§éããæéã®å¶éã
æéç¶æ ãã·ã³ã«ã€ããŠç¥ãããããšã¯ãã¹ãŠãããŸããã...
äžè¬ã«ãDavid HarelïŒ StatechartsïŒA Visual Formalism For Complex SystemsïŒ1987ïŒãããç¶æ å³ã®åœ¢åŒè¡šèšã®ãããã¯ã«é¢ããåºæ¬çãªèšäºããããŸãã
ããã§ã¯ãéåžžã®é»åæèšãå¶åŸ¡ããäŸã䜿çšããŠãæéç¶æ ãã·ã³ã§äœæ¥ãããšãã«ééããå¯èœæ§ã®ããããŸããŸãªç¶æ³ã調ã¹ãŸãã 誰ãããããèªãã§ããªãå Žåãç§ã¯ããã匷ããå§ãããŸãã åºæ¬çã«ãHarelã説æãããã¹ãŠã®ãã®ã¯UMLè¡šèšã«ãªããŸããã ããããUMLããç¶æ å³ã®èª¬æãèªããšãããããäœãããªãããã€å¿ èŠãšããããåžžã«ç解ããŠããããã§ã¯ãããŸããã ããããHarelã®èšäºã§ã¯ããã¬ãŒã³ããŒã·ã§ã³ã¯åçŽãªç¶æ³ããããè€éãªç¶æ³ã«ç§»è¡ããŠããŸãã ãããŠãæéç¶æ ãã·ã³ãããèªäœã«é ããŠãããã¹ãŠã®åãããããèªèããŠããŸãã
æãããªã¹ããŒããã·ã³ã®æŠèŠ
ãµããžã§ã¯ããšãªã¢ã«æåéãã¹ããŒããã·ã³ãããµããŠããå Žåã¯ãã¢ã¯ã¿ãŒã®ã¢ãã«ãžã®çŽæ¥ãã¹ããããŸãã
ã·ã§ã¢ãŒãããã·ã³ã°ã¢ãŒããã¯ãã£
次ã®ããŒã«ãŒã¯ããããæãéèŠãªãã®ã§ããã€ãŸãã察象é åã§ã®ã·ã§ã¢ãŒãããã·ã³ã°ã®ååã«åŸãããšãããã«ç°¡åããšããããšã§ãã
ããªãã¡ ãšã³ãã£ãã£ã¯å ±æããŒã¿ãªãã§åç¶ããåäœã§ããŸããïŒ
å¶éãè¶ ããå Žåãåãšãã»ã³ã¹ããéåæã¡ãã»ãŒãžã®ã¿ãä»ããŠä»ã®åæ§ã®ããã»ã¹ãšéä¿¡ããèªåŸOSããã»ã¹ãšããŠè¡šãããšã¯å¯èœã§ããïŒ
çæ³çã«ã¯ãã¢ã¯ã¿ãŒã«ã¯å ±éã®ããŒã¿ãæãããªãã§ãã ããã åã¢ã¯ã¿ãŒã¯ç¬ç«ããç¬ç«ãããšã³ãã£ãã£ã§ãã 誰ã«ãèŠããªã圌èªèº«ã®ç¶æ ã§ã ãããã£ãŠãåã¢ã¯ã¿ãŒãç¬èªã®ã¢ãã¬ã¹ç©ºéãæã€ç¬ç«ããç¬ç«ããããã»ã¹ã§ãããšãã究極ã®ã¢ã€ãã¢ã¯éåžžã«æ£åœåãããŸãã
確ãã«ãããã¯ãã極端ã§ãã ãããŠãäŸãã°å¹çã®çç±ã§ãããããé¢ããããšãã§ããŸãã ããã§ããååãšããŠãåã¢ã¯ã¿ãŒãåå¥ã®ããã»ã¹ã§ãããœãªã¥ãŒã·ã§ã³ãæ³åã§ããå Žåãããã¯è¯ãå åã§ãã
ããã§2ã€ã®éèŠãªç¹ã«æ³šæããŠãã ããã
å ±æã§ãããã®ã¯åžžã«å¯èœãšã¯éããªã
第äžã«ãShared Nothingã®ååãåžžã«é å®ã§ããããšã¯æããã§ãã
ããšãã°ããœãŒã·ã£ã«ã³ãã¯ã·ã§ã³ã®å€§ããªã°ã©ãã念é ã«çœ®ãããšãã§ããŸãã ãããŠãå€ãã®ãªã¯ãšã¹ããå¹ççã«åŠçããããã«ããããã®ãªã¯ãšã¹ãã®ãã«ãã¹ã¬ããåŠçãå¿ èŠã«ãªãå ŽåããããŸãã ã¯ãŒã¯ãããŒã¯ãã°ã©ãã®å®å šæ§ã䟵害ããªãããã«ãã°ã©ããå ±åææããäœããã®åæã¡ã«ããºã ã䜿çšããããšã匷å¶ãããŸãã
å¥ã®äŸïŒèšç®äžã®åé¡ã èšç®ã«é¢ä¿ããããã€ãã®å€§ããªè¡åãæãåºãããšãã§ããŸãã èšç®ãé«éåããããã«ãããã€ãã®äžŠåã¹ã¬ãããå®è¡ã§ããŸãããããã®ã¹ã¬ããã¯å ±éã®ããŒã¿ãšé£æºããŠæ©èœããŸãã
ããã¯ãã¹ãŠç§ãã¡ãèŠäžããé«ãã«äŸåããŠããŸã...
第äºã«ãç¶æ³ã¯ãã¿ã¹ã¯ãæ€èšããæœè±¡åã®ã¬ãã«ã«å¿ããŠæ ¹æ¬çã«å€åããå¯èœæ§ããããŸãã
ãªã³ã©ã€ã³æ ç»é€šã®äŸã«æ»ããŸãããã ãäžããã®å€§éšåããèŠããšãShared Nothingã¢ãŒããã¯ãã£ãããªãèŠãããŸãã èªèšŒãµãã·ã¹ãã ã¯ç¬èªã®ããŒã¿ã§åäœãã課éã¯ç¬èªã®ããŒã¿ã§åäœããéç¥ãµãã·ã¹ãã ã¯ç¬èªã®ããŒã¿ã§åäœããŸãã ãããã¯ãã¹ãŠå ±æãããã®ãäœããããŸããã éåæã¡ãã»ãŒãžãä»ããŠã®ã¿çžäºã«éä¿¡ããŸãã ã€ãŸããå®éã«ã¯ã圌ãã¯ãã¹ãŠä¿³åªã§ãã
ãã ããç¹å®ã®ã³ã³ããŒãã³ãã®å®è£ ã¬ãã«ã«äžãã£ãå ŽåãååãšããŠãã§ã«èªåŸåã¢ã¯ã¿ãŒã¯ååšããªãå¯èœæ§ããããŸãã
ããšãã°ã課éãµãã·ã¹ãã ã§ã¯ãRAMã«å·šå€§ãªããŒã¿æ§é ããããããã«éåžžã«å·§åŠã«æ©èœããããã€ãã®ã¯ãŒã¯ãããŒããããŸãïŒããšãã°ãããã¯ããªãŒã¢ã«ãŽãªãºã ãæ°žç¶çãªããŒã¿æ§é ã䜿çšããŸãïŒã
ããªãã¡ æŠå¿µã¬ãã«ã§ã¯ã¢ã¯ã¿ãŒã®ã¢ãã«ãããããã«èŠãããããããŸããããå®è£ ã¬ãã«ã§ã¯ã³ãŒãå ã«éåžžã®ãã«ãã¹ã¬ããåœä»€åãŽããããŒãã³ã¢ããœãããŒããããŸãã
ããã¯æ£åžžã§ãã Model of Actorsã¯åãªãã³ãŒãäœæã®ããªãã¯ã§ã¯ãããŸããã ãã¡ã€ã³åæãšãœãããŠã§ã¢ã·ã¹ãã èšèšãžã®ã¢ãããŒãã§ããããŸãã
ãããã£ãŠãèšèšã¬ãã«ã§ã¢ã¯ã¿ãŒã¢ãã«ã䜿çšããŠãæŠå¿µçã«ã¢ã¯ã¿ãŒã§ããã³ã³ããŒãã³ãã匷調衚瀺ã§ããŸãã ããããå®è£ ã¬ãã«ã§ã¯ãã¢ã¯ã¿ãŒã®ã¢ãã«ã«ã¯äœãæ®ããŸããã
äžè¬çã«ãéã®ç¶æ³ããããŸãïŒã¢ããªã±ãŒã·ã§ã³ã¯å·šå€§ãªã¢ããªã¹ã§ãããã¹ããªãŒã éã§å ±æãããããŒã¿ãå®å šã«äœ¿çšã§ããŸããããã®ã¢ããªã±ãŒã·ã§ã³ã®äžéšã§ã¯ãã¢ã¯ã¿ãŒã¢ãã«ãç°¡åã«äœ¿çšããŠãå®éã«ã¢ããªã±ãŒã·ã§ã³ã®äžéšãæ®ãã®ã³ãŒãããåé¢ã§ããŸãã
ç·å ±æãªã
Shared Nothingã¢ãŒããã¯ãã£ã®äœ¿çšãå°é£ã§ããããè¿œå ã®ãªãŒããŒããããçºçããå Žåãã¢ã¯ã¿ãŒã®ã¢ãã«ã«ç®ãåããããšã¯ã§ããŸããã
ããããäžè¬çã«ãShared Nothingã¯çŽ æŽãããããšã§ãã ããã¯äººçãå€§å¹ ã«ç°¡çŽ åããŸãã ç¹ã«ãã«ãã¹ã¬ããããã°ã©ãã³ã°ã§ã ãŸããã¢ã¯ã¿ãŒã¢ãã«ã¯ãShared Nothingã¢ãŒããã¯ãã£ã®å®è£ ã«è²¢ç®ããŸãã ãããã£ãŠãShared Nothingã¢ãŒããã¯ãã£ã䜿çšããŠã¢ããªã±ãŒã·ã§ã³ã·ã¹ãã ãæ§ç¯ããããšããŠããå Žåãã¢ã¯ã¿ãŒã¯ããã倧ãã«æ¯æŽã§ããŸãã
ã¿ã€ããŒ
ãããšã¯å¥ã«ãã¿ã€ããŒã§äœæ¥ãåæ¢ãã䟡å€ããããŸãã
ããã¯ãã¿ã€ããŒãModel of Actorsã«åºæã®ç¹å¥ãªããŒã«ãŒã®äžçš®ã§ãããšèšãããšã§ã¯ãããŸããã ãã ããéä¿¡ããŠå¿ãããšããååã®ãããã¿ã€ããŒã®äœ¿çšã¯éåžžã«éèŠã§ãã äœããã®æäœãéå§ãããã°ããããŠãã®çµæã確èªããå¿ èŠããããŸãã ãã®å Žåãã¿ã€ããŒã䜿çšãã䟿å©ãªäœæ¥ãäžå¯æ¬ ã§ãã
ã¢ã¯ã¿ãŒã®å Žåãã¿ã€ããŒã¯ä¿çã¡ãã»ãŒãžã䜿çšããŠå®è£ ãããŸãã ãšãŠã䟿å©ã§ã ã¿ã€ããŒãããªã¬ãŒããããšãéåžžã®ã¡ãã»ãŒãžã衚瀺ãããŸãã
ç°¡åãªäŸãèŠãŠã¿ãŸãããïŒ
ãŠãŒã¶ãŒãããªã¯ãšã¹ããåãåããŸãã ãã ããåäžã®èŠæ±ãåŠçããããšã¯äžå©ãªãããããã«åŠçããå¿ èŠã¯ãããŸããã å°ãåŸ ã€ããšãã§ããŸãã çªç¶ããã«ããã€ãã®ãªã¯ãšã¹ããå±ãããããããã¹ãŠäžæ¬åŠçã§ããŸãã ããšãã°ã100åã®ã¢ããªã±ãŒã·ã§ã³ã®ã°ã«ãŒãã§ãªã¯ãšã¹ããåŠçããããšã¯æçã§ãã ããã¯ãã¡ãããåäžã®ãªã¯ãšã¹ãã®ã¬ã€ãã³ã·ãæªåãããŸããããµãŒãã¹ã®ã¹ã«ãŒããããåäžãããŸãã
次ã®2ã€ã®æ¡ä»¶ãæºãããããŸã§åŸ ã€å¿ èŠãããããšãããããŸãã
- ãŸãã¯ã100件ã®ãªã¯ãšã¹ããèç©ããããããäžåºŠã«åŠçããŸããã
- ãŸãã¯ãããšãã°250ããªç§åŸ æ©ããŠãå°çãããã¹ãŠã®ãã®ãåŠçããŸãã 99ã¯99ãæå³ããŸãã1ã¯1ãæå³ããŸãã
ããã¯éåžžã«ç°¡åã«å®è£ ãããŸãïŒ
class bunch_processor { ... public: void on_request(request & req) { requests_.push_back(move(req)); if(1 == requests_.size()) timeout_timer_ = send_delayed<timeout>(this, 250ms); else if(100 == requests_.size()) { timeout_timer_.reset(); handle_collected_requests(); } } void on_timer(timeout&) { handle_collected_requests(); } ... };
ã¿ã€ããŒã®ãããã¯ããŸãšãããšã俳åªãšã¿ã€ããŒã¯ãäºãã«ãšãŠãè¯ãåéã ãšèšããŸãã ãããã£ãŠãã¿ã¹ã¯ã§ã¿ã€ããŒã䜿çšããäœæ¥ãå€ãå Žåãã¢ã¯ã¿ãŒã¢ãã«ããããæ¯æŽããŸãã
ããã¯ã©ãã«é©çšã§ããŸããïŒ
ããŠããããªã¢ã«ãçµ±åããããã«ãã¢ã¯ã¿ãŒã®ã¢ãã«ãããèªäœã確ç«ããŠããé åããã°ããæ©ããŠã¿ãŸãããã ããã«ç§ãèšãããšã¯ãç§èªèº«ã®çµéšãšã俳åªã®ã¢ãã«ã®ãããã¯ã«ã€ããŠè°è«ããååã®çµéšã«åºã¥ããŠããŸãã
èšå管ç
æåã«æãæµ®ãã¶ã®ã¯ãã³ã³ãã¥ãŒã¿ãŒã䜿çšããå®éã®æ©åšã®ç®¡çã§ãã ããšãã°ãç£æ¥ãªãŒãã¡ãŒã·ã§ã³ã¿ã¹ã¯ã
å€éšããã€ã¹ã®åäœã¯ãå€ãã®å Žåãã¹ããŒããã·ã³ã䜿çšããŠèšè¿°ãããŸãã ãããã£ãŠãããã°ã©ã èªäœã®ããã€ã¹ãæäœããããã«æéç¶æ ãã·ã³ã䜿çšãããããšã¯é©ãããšã§ã¯ãããŸããã
éåæã¡ãã»ãŒãžãä»ããã¢ã¯ã¿ãŒéã®çžäºäœçšããå®éã®æ©åšã§ã®äœæ¥ãšéåžžã«ãã䌌ãŠããŸãã å€ãã®å Žåãå€éšããã€ã¹ãšã®éä¿¡ã¯æ£ç¢ºã«éåæã§å®è¡ãããŸãã ããå ¥å/åºåããŒãã«ã³ãã³ããæžããšããŸãããã ãã®åŸããã°ããåŸ ã£ãŠãããä»ã®I / OããŒãã®å 容ãèªã¿åã£ãŠãã³ãã³ããå®è¡ããããã©ããã確èªããå¿ èŠããããŸãã ã¡ãªã¿ã«ããã®ãããªå Žåã®ã¿ã€ããŒã®äŸ¿å©ãªäœæ¥ã¯éåžžã«åœ¹ç«ã¡ãŸãã
ã·ãã¥ã¬ãŒã·ã§ã³
ãã1ã€ã®åéã¯ããã¥ãŒã·ã¹ãã ãªã©ã®ããã»ã¹ã®ã·ãã¥ã¬ãŒã·ã§ã³ã§ãã ç¹ã«ãå€çš®å€æ§ãªãšã³ãã£ãã£ãé¢äžããããã»ã¹ïŒããšãã°ã ãšãŒãžã§ã³ãããŒã¹ã®ã¢ãã«ãåç §ïŒã
ã¢ã¯ã¿ãŒã¯ç¬èªã®åäœãæã€èªåŸçãªãšã³ãã£ãã£ã§ããããããããã䜿çšãããšãå®éã®ãªããžã§ã¯ããã¢ãã«åããã®ã«äŸ¿å©ã§ããããšãããããŸãã å®å šã«ç°ãªãã¿ã€ãã®ã¢ã¯ã¿ãŒãäœæã§ããŸããäžéšã®ãã©ã¡ãŒã¿ãŒã®å€ã®ã¿ãç°ãªãåãã¿ã€ãã®ã¢ã¯ã¿ãŒãäœæã§ããŸãã ã¢ãã«ã«ã¯å°ãªããšã100äžäººã®ã¢ã¯ã¿ãŒãå ¥åã§ããŸãããããããã®ã¢ã¯ã¿ãŒã¯å°ãªããšãä»ã®ã¢ã¯ã¿ãŒãšã¯å€å°ç°ãªããŸãã ããã«ãããã·ãã¥ã¬ãŒã·ã§ã³ã®åéã§è€éãªå®éšãè¡ãããšãã§ããŸãã
ãã¹ãç°å¢ã®éçº
倧èŠæš¡ãªãœãããŠã§ã¢ã·ã¹ãã ã®ã³ã³ããŒãã³ããéçºããå Žåãé£æ¥ããã³ã³ããŒãã³ãã®åäœãæš¡å£ãããã¹ãç°å¢ãäœæããå¿ èŠãããå ŽåããããŸãã ããã¯ãããŸããŸãªçç±ã§å¿ èŠã«ãªãå ŽåããããŸãã
- é£æ¥ããã³ã³ããŒãã³ãèªäœã¯ãŸã å©çšã§ããªãå ŽåããããŸãã ãããã¯äžŠè¡ããŠéçºãããŠããããŸã çµ±åçµ±åãã¹ãã®æºåãæŽã£ãŠããªãå¯èœæ§ããããŸãã ãããã£ãŠãããã§çŸåšã®é£æ¥ã³ã³ããŒãã³ãã眮ãæããããšãã§ããäœããã®ã·ãã¥ã¬ãŒã¿ãå¿ èŠã§ãã
- é£æ¥ããã³ã³ããŒãã³ãã®ç°åžžãªåäœãã·ãã¥ã¬ãŒãããå¿ èŠãããå ŽåããããŸãã ããšãã°ã5çªç®ã®èŠæ±ã«å¯Ÿããå¿çãå€§å¹ ã«é 延ããã10çªç®ã®èŠæ±ã«ã¯ãŸã£ããå¿çãããäœããã®ãŽãã§20çªç®ã®èŠæ±ã«å¿çããã«ã¯ãé£æ¥ããã³ã³ããŒãã³ããå¿ èŠã§ãã
å°èŠæš¡ãªã·ã¹ãã ãéçºããå Žåãããšãã°å€éšæ©åšã䜿çšããå Žåããã®æ©åšããŸã æã£ãŠããªãå Žåã§ããç¬èªã®ãã¹ãç°å¢ãå¿ èŠã«ãªãå ŽåããããŸãã ãã ããå€éšããã€ã¹ã®äœããã®ã·ãã¥ã¬ãŒã¿ãå¿ èŠã§ãã
ãã®ãããªå Žåãã¢ã¯ã¿ãŒã®ã¢ãã«ã«åºã¥ããã·ãã¥ã¬ãŒã¿ãŒãç°¡åãã€èªç¶ã«å®è£ ãããããšãçµéšããããã£ãŠããŸãã ããã¯å¶ç¶ã§ã¯ãããŸãããããã§ã¯ãåè¿°ã®ããã«ãæ©åšã®æäœãšã·ãã¥ã¬ãŒã·ã§ã³ã®éã«å€ãã®å ±éç¹ãããããšãããããŸãã
ãã€ãã©ã€ã³ããŒã¿/ãã©ã³ã¶ã¯ã·ã§ã³åŠç
ããŒã¿ã¹ããªãŒã ãŸãã¯ãã©ã³ã¶ã¯ã·ã§ã³ã¹ããªãŒã ã®ãã€ãã©ã€ã³åŠçã¯ãModel of Actorsã®äžåç£ã§ã¯ãããŸããã ããã¯ãã§ã«ããŒã¿ãããŒããã°ã©ãã³ã°ã®é åã§ãã ãã ããå®éã«ã¯ãã¢ã¯ã¿ãŒã®ã¢ãã«ã¯ãã³ã³ãã¢åŠçãæ§ç¯ãããåºç€ã«ãªãããããªããŸãã ãã®ããããã€ãã©ã€ã³ã®å段éã¯ã¢ã¯ã¿ãŒã«ãã£ãŠç°¡åã«å®è£ ããã1ã€ã®æ®µéããå¥ã®æ®µéãžã®æ å ±ã®è»¢éã¯éåæã¡ãã»ãŒãžã«ãã£ãŠå®è¡ãããŸãïŒãã®ãããªã¿ã¹ã¯ã§ã¯send-and-forgetã®åçã¯å¿«é©ã§ãïŒã
ãã®ãããªã¿ã¹ã¯ã®ã¢ã¯ã¿ãŒã®å€§ããªãã©ã¹ã¯ãã¢ã¯ã¿ãŒãç¶æ ãæã£ãŠããããšã§ããããã«ãããã¢ã¯ã¿ãŒã¯é¢çœãããšãããããšãã§ããŸãã ããšãã°ãåäžã®ãªã¯ãšã¹ãããã±ããã«èç©ããŠãããã«ãããåŠçãå®è¡ãããããã«ããŸãã äžèšã®ãããªäŸãæ¢ã«æ€èšããŸããïŒã¢ã¯ã¿ãŒã¯æåã®ãªã¯ãšã¹ããåãåããã¿ã€ããŒãéå§ããå®å šãªãã±ããã圢æãããããã¿ã€ããŒãæ©èœãããŸã§åŸ æ©ããŸãã
ãã1ã€ã®äŸ¿å©ãªç¹ã¯ãã¢ã¯ã¿ãŒããã€ããã¯ã¹ã§æ¥ç¶ãåæ§ç¯ã§ããããšã§ãã ããšãã°ã圌ã«åŸå±ãã5人ã®ã¯ãŒã«ãŒã¢ã¯ã¿ãŒã§è² è·åæ£ãå®è¡ããã¢ã¯ã¿ãŒãããå ŽåããããŸãã ãã©ã³ãµãŒã¯ãåã¯ãŒã«ãŒã次ã®ãã±ãããåŠçããæéã远跡ã§ããŸãã ãããŠããã®æéãå¢å ãå§ããããšãæ€åºããå Žåããã©ã³ãµãŒã¯ãã®åé¡ã¯ãŒã«ãŒã®è² è·ãæžããããšãã§ããŸãã
確ãã«ãããŒã¿ããã€ãã©ã€ã³åããã¿ã¹ã¯ã«ã¢ã¯ã¿ãŒãé©çšãããšãããã¯ãã¬ãã·ã£ãŒã®åé¡ãçºçããŸãã ããããããã¯ãŸã£ããç°ãªã話ã§ãã ããã«ãå®å šã«è§£æ±ºå¯èœã§ãã ãŸããåãAkkaã«ã¯ãAkka StreamsããããŸããããã¯ãéåžžã®Akka-actorsã®äžã«æ§ç¯ãããŸãã
çµè«ãšããŠããã€ãã®ãããµãã
ç§ã¯ãã£ããã³ãšããã³ã¹ã®åœ¹å²ãå®äºãããã®ã§ãããã€ãã®äžè¬çãªïŒ
- åé¡ã解決ããããã®ã¢ãããŒããéžæãããšãã¯ãåžžèã«å°ãããå¿ èŠããããŸãã
- åžžèã«ãããšã俳åªã®ã¢ãã«ã¯ç¹å¹è¬ã§ã¯ãããŸããã
- å Žåã«ãã£ãŠã¯ãã¢ã¯ã¿ãŒã®ã¢ãã«ãå®éã«ç掻ã楜ã«ããŸãã
- ããããç掻ã楜ã«ããããã«ã¯ãã¢ã¯ã¿ãŒã¢ãã«ã§ã®äœæ¥çµéšãå¿ èŠã§ãã
- ãã®çµéšã¯ãããã¡ãã®ãããã¿ã€ãã§æãããåŸãããŸãã
- ãã®ãããªçµéšãåŸãããã«ãC ++ã§å©çšå¯èœãªæ¢è£œã®ã¢ã¯ã¿ãŒãã¬ãŒã ã¯ãŒã¯ãå©çšã§ããŸãã