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

Swift Concurrencyを導入するにあたって決めたこと

hicka04
March 15, 2022

Swift Concurrencyを導入するにあたって決めたこと

hicka04

March 15, 2022
Tweet

More Decks by hicka04

Other Decks in Programming

Transcript

  1. mixi, Inc. ࣗݾ঺հ ˔ ࠤ౻ ޫ !IJDLB ˔ גࣜձࣾϛΫγΟ ΈͯͶࣄۀ෦

    ϓϩμΫτ։ൃάϧʔϓ ˓ த్ೖࣾ ˔ ޷͖ͳ΋ͷ ˓ ϥʔϝϯ ˓ ϙέϞϯ
  2. mixi, Inc. 4XJGU$PODVSSFODZʹ͍ͭͯ BTZODBXBJU ˔ BTZOD ΩʔϫʔυΛ͚ͭΔ͜ͱͰඇಉظॲཧͰ͋Δ͜ͱΛϚʔΫͰ͖Δ BXBJUΩʔϫʔυΛ͚ͭͯݺͼग़͢ ˔ BTZOD

    Ωʔϫʔυ͕͍͍ͭͯΔϝιου΍ϓϩύςΟΛݺͼग़ͨ͢Ίͷ৚݅ ˓ BTZODΩʔϫʔυ͕͍͍ͭͯΔϝιου΍ϓϩύςΟ͔Βݺͼग़͢ ˓ 5BTL ʹ౉͢Ϋϩʔδϟ಺͔Βݺͼग़͢
  3. mixi, Inc. 4XJGU$PODVSSFODZʹ͍ͭͯ BDUPS ˔ ෳ਺εϨου͔ΒಡΈॻ͖ͨ͠ͱ͖ͷσʔλڝ߹Λ๷͙ ˓ ಡΈॻ͖ཁٻ͕Ωϡʔʹੵ·Εɺॱ൪ʹॲཧ͞ΕΔ ˓ BDUPSΠϯελϯε͝ͱʹΩϡʔ͕࡞ΒΕΔ

    ˔ HMPCBM"DUPS ˓ ಡΈॻ͖ཁٻͷΩϡʔΛෳ਺ͷΠϯελϯεͰڞ༗͢Δ ˔ .BJO"DUPS ˓ ಡΈॻ͖ཁٻΛϝΠϯΩϡʔʹੵΜͰ͘ΕΔHMPCBM"DUPS ˓ දࣔσʔλΛ؅ཧ͢ΔΫϥεʹΛ͚ͭΔͱɺϝΠϯεϨου΁ͷ੾Γସ͑๨ΕʹΑΔΫϥογϡΛ๷͛Δ
  4. mixi, Inc. ࠾༻͍ͯ͠ΔΞʔΩςΫνϟʹ͍ͭͯ ˔ ΞʔΩςΫνϟύλʔϯ ˓ $MFBO"SDIJUFDUVSF ˓ .71 1BTTJWF7JFX

    ˔ ඇಉظॲཧ ˓ 3Y4XJGU ˓ Ϋϩʔδϟ IUUQTNJYJEFWFMPQFSTNJYJDPKQNJUFOFJPTDMFBOBSDIJUFDUVSFEE
  5. mixi, Inc. ܾΊͨ͜ͱ  σʔλ૚ 3FNPUF ˔ "MBNPGJSF  Λར༻த

    ˓ "MBNPGJSFΛ4XJGU$PODVSSFODZରԠόʔδϣϯ  ·Ͱ্͛Δ ˓ ࣗ෼ͰFYUFOTJPOϝιουΛੜ΍͢ ˔ ݱঢ়͸ޙऀΛ࠾༻ ˓ "MBNPGJSFͷϝδϟʔόʔδϣϯΞοϓ଴ͪͰ4XJGU$PODVSSFODZͷಋೖ͕Ͱ͖ͳ͍ࣄଶΛආ͚Δ ˓ όʔδϣϯΞοϓ׬ྃ࣍ୈɺॱ࣍FYUFOTJPOϝιουͷར༻Λ΍Ί͍ͯ͘ IUUQTHJUIVCDPN"MBNPGJSF"MBNPGJSFSFMFBTFT
  6. mixi, Inc. ܾΊͨ͜ͱ  σʔλ૚ -PDBM ˔ ϩʔΧϧͷσʔλಡΈॻ͖͸ɺओʹ 3FBMN PS6TFS%FGBVMUT

    ˔ 3FBMNͷެࣜυΩϡϝϯτͷ 5ISFBEJOHͷϖʔδ͔Βൈਮ ˓ %PObUMPDLUPSFBE ಡΈࠐΈΛϩοΫ͠ͳ͍Ͱ ˓ "WPJEXSJUFTPOUIF6*UISFBEJGZPVXSJUFPOBCBDLHSPVOEUISFBE 6*εϨουͰॻ͖ࠐΈ͠ͳ͍Ͱ ˔ ಛఆͷεϨου ಛʹ6*εϨου Λ઎༗͢ΔͱΞϓϦύϑΥʔϚϯεʹେ͖ͳӨڹ͕ͰΔ ˓ Ξοϓϩʔυͨ͠ϝσΟΞͷΩϟογϡ౳Ͱར༻͍ͯ͠Δ ˓ ສ୯ҐͰΞοϓϩʔυ͍ͯ͠ΔϢʔβʔ΋͍Δ ˔ બ୒ࢶ ˓ HMPCBM"DUPSΛ࢖͏ ಛఆͷεϨουΛ઎༗ͯ͠͠·͍΍͘͢ͳΔ ˓ XJUI$IFDLFE 5ISPXJOH $POUJOVBUJPOº %JTQBUDI2VFVFΛ࢖͏ ($%୤٫͍ͨ͠ ˓ 5BTLEFUBDIFEΛ࢖͏ IUUQTEPDTNPOHPECDPNSFBMNTELTXJGUBEWBODFEHVJEFTUISFBEJOH
  7. mixi, Inc. ܾΊͨ͜ͱ  σʔλ૚ -PDBM ˔ 5BTLEFUBDIFEΛ࢖͏ ˓ ಛఆͷεϨουΛ઎༗ͮ͠Β͍

    ˓ 4XJGU$PODVSSFODZͷػೳ͚ͩͰ࣮ݱͰ͖Δ ˔ ࣗ෼ͰΩϟϯηϧॲཧΛॻ͘ඞཁ͕͋Δ ˓ 3FBMNʹಡΈॻ͖ΛΩϟϯηϧ͢ΔΠϯλʔϑΣΠε͕ͳ͍ͨΊߟྀ֎ ˔ ࢖͏ଆͰγϯϓϧʹॻ͚ΔΑ͏ʹQSPUPDPMΛ༻ҙ ˓ 3FBMNΞΫηε͢Δ֤-PDBM%BUB4PVSDF͕४ڌͯ͠࢖͏ IUUQTEFWFMPQFSBQQMFDPNEPDVNFOUBUJPOTXJGUUBTLEFUBDIFE
  8. mixi, Inc. ܾΊͨ͜ͱ r ϓϨθϯςʔγϣϯ૚ Ͳ͜ʹ !.BJO"DUPSΛ͚ͭΔ͔ ˔ 7JFX7JFX$POUSPMMFSͷΈ ˔

    1SFTFOUFSͰ͸ঢ়ଶ؅ཧΛ͍ͯ͠ͳ͍ͨΊݱঢ়͸ෆཁͱ൑அ Ͳ͜Ͱ 5BTLΛੜ੒͢Δ͔ ˔ 7JFX7JFX$POUSPMMFSͰੜ੒ ˔ 1SFTFOUFS͕7JFXʹରͯ͠ެ։͢Δϝιουʹ BTZODΩʔϫʔυΛ͚ͭΔ Ͳ͜·ͰΩϟϯηϧॲཧΛؤுΔ͔ ˔ Ͳ͏ͯ͠΋Ωϟϯηϧ͍ͨ͠ͱ͖ ΩϟϯηϧϘλϯΛஔ͍ͯΔͳͲ Ҏ֎͸ؤுΒͳ͍ ˔ 5BTLʹTFMGΛΩϟϓνϟͤ͞Δͱɺඇಉظॲཧ͕ऴΘΔ·ͰࢀরΧ΢ϯτ͕ݮΒͣϝϞϦϦʔΫʹͳΔ ˓ ແݶϧʔϓͯ͠ͳ͚Ε͹͍͔ͭ͸ऴΘͬͯ։์͞ΕΔ ˓ ίϯύΠϥͰ๷͙͜ͱ͕೉͍ͨ͠ΊϨϏϡʔίετ্͕͕Δ
  9. mixi, Inc. ܾΊͨ͜ͱ r ςετίʔυ ςεςΟϯάϑϨʔϜϫʔΫ ˔ ݱঢ়9$5FTUPS2VDJL ˔ 2VJDL͸ݱࡏɺ4XJGU$PODVSSFODZະରԠ

    ˔ ࠓޙ͸9$5FTUΛ࢖͏ ϞοΫ ˔ ݱঢ়4PVSDFSZ ˔ બ୒ࢶ ˓ .PDLPMPʹมߋ πʔϧΛ૿΍͞ͳ͍ͨΊ ˓ 4PVSDFSZΛ4XJGU$PODVSSFODZରԠόʔδϣϯʹΞοϓσʔτ IUUQTHJUIVCDPN2VJDL2VJDLSFMFBTFT IUUQTHJUIVCDPNLS[ZT[UPG[BCMPDLJ4PVSDFSZSFMFBTFT
  10. mixi, Inc. ܾΊͨ͜ͱ r Ҡߦܭը ˔ 4XJGUʹඋ͑ͯɺݱঢ়ग़͍ͯΔΤϥʔ΍ϫʔχϯάʹରԠ͢Δ ˓ 9GSPOUFOEXBSODPODVSSFODZ ˓

    9GSPOUFOEFOBCMFBDUPSEBUBSBDFDIFDLT ˔ ৽نͰ࡞ΔػೳͰੵۃతʹ࠾༻͍ͯ͘͠ ˔ طଘͷػೳʹґଘ͢Δඞཁ͕͋Δ৔߹͸ҎԼ͔Βબ୒ ˓ طଘͷඇಉظॲཧΛ BTZODϝιουʹஔ͖׵͍͑ͯ͘ ˓ ৽نͰ BTZODϝιουΛ࡞੒ͯ͠ঃʑʹஔ͖׵͍͑ͯ͘ Өڹൣғ͕޿ͯ͘ஔ׵͕େมͳͱ͖ ˙ 3Y4XJGU4XJGU$PODVSSFODZରԠόʔδϣϯ·ͰΞοϓσʔτͯ͠ 0CTFSWBCMFˠBTZODม׵ ˙ ΫϩʔδϟXJUI$IFDLFE 5ISPXJOH $POUJOVBUJPOΛ࢖ͬͯ BTZODʹม׵ ˔ ϦϦʔεલʹ͸֤04όʔδϣϯͰͷ2"Λߦ͏ IUUQTGPSVNTTXJGUPSHUDPODVSSFODZJOTXJGUBOEDPODVSSFODZJOTXJGUBOE