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

process.nextTick differences between node-v0.8 ...

wagyu298
September 24, 2014

process.nextTick differences between node-v0.8 and node-v0.11

東京OtakuMode学園#1 LTスライド

wagyu298

September 24, 2014
Tweet

More Decks by wagyu298

Other Decks in Programming

Transcript

  1. 6TFUIF4PVSDF -VLFʜ BKT DPOTPMFMPH CFHJO  ! TFU5JNFPVU GVODUJPO \

    DPOTPMFMPH TFU5JNFPVU  ^   ! QSPDFTTOFYU5JDL GVODUJPOG \ QSPDFTTOFYU5JDL G  ^  ! DPOTPMFMPH FOE 
  2. OPEFKTW OPEFW W OPEFBKT CFHJO FOE OPEF XBSOJOH3FDVSTJWFQSPDFTTOFYU5JDLEFUFDUFE5IJTXJMMCSFBLJOUIFOFYUWFSTJPOPGOPEF 1MFBTFVTFTFU*NNFEJBUFGPSSFDVSTJWFEFGFSSBM 

    OPEF XBSOJOH3FDVSTJWFQSPDFTTOFYU5JDLEFUFDUFE5IJTXJMMCSFBLJOUIFOFYUWFSTJPOPGOPEF 1MFBTFVTFTFU*NNFEJBUFGPSSFDVSTJWFEFGFSSBM ! 3BOHF&SSPS.BYJNVNDBMMTUBDLTJ[FFYDFFEFE TFU5JNFPVU͸ಈ͔ͳ͍ɺམͪΔ
  3. OPEFKTW OPEFW W OPEFBKT CFHJO FOE OPEF XBSOJOH3FDVSTJWFQSPDFTTOFYU5JDLEFUFDUFE5IJTXJMMCSFBLJOUIFOFYUWFSTJPOPGOPEF 1MFBTFVTFTFU*NNFEJBUFGPSSFDVSTJWFEFGFSSBM 

    OPEF XBSOJOH3FDVSTJWFQSPDFTTOFYU5JDLEFUFDUFE5IJTXJMMCSFBLJOUIFOFYUWFSTJPOPGOPEF 1MFBTFVTFTFU*NNFEJBUFGPSSFDVSTJWFEFGFSSBM ! 3BOHF&SSPS.BYJNVNDBMMTUBDLTJ[FFYDFFEFE TFU5JNFPVU͸ಈ͔ͳ͍ɺམͪΔ
  4. ֤όʔδϣϯͷOFYU5JDLͷڍಈ w OPEFWΠϕϯτϧʔϓதͰճ࣮ߦ͞ΕΔSVO@JEMF  SVO@QSFQBSF SVO@DIFDLɻOFYU5JDLΛ࠶ؼͯ͠΋ͱΠϕ ϯτϧʔϓ͕ࢭ·Βͳ͍ɻ w OPEFW 7Ͱ+4Λ࣮ߦͨ͠௚ޙʹOFYU5JDL͕શ

    ෦࣮ߦ͞ΕΔɻOFYU5JDLΛ࠶ؼ͢ΔͱΠϕϯτϧʔϓ͕ࢭ ·Δɻ͔ͭOFYU5JDLͷελοΫαΠζʹ੍ݶ͋Γɻ w OPEFW7Ͱ+4Λ࣮ߦͨ͠௚ޙʹOFYU5JDL͕શ෦࣮ ߦ͞ΕΔɻOFYU5JDLΛ࠶ؼ͢ΔͱΠϕϯτϧʔϓ͕ࢭ·Δɻ ελοΫαΠζ੍ݶͳ͠ɻ
  5. ͜͏Ͱ͔͢ʁ WBS&WFOU&NJUUFSSFRVJSF FWFOUT &WFOU&NJUUFS ! GVODUJPO4PNFUIJOH'VOD SFTPVSDF/BNF \ WBSTFMGUIJT !

    QSPDFTTOFYU5JDL GVODUJPO \ TFMGFNJU TUBSU  ^  ! EP4PNFUIJOH GVODUJPO EBUB \ UIJTFNJU EBUB EBUB  ^  ^ ! 4PNFUIJOH'VODQSPUPUZQF@@QSPUP@@&WFOU&NJUUFSQSPUPUZQF ! (SBCGSPNA6OEFSTUBOEJOHQSPDFTTOFYU5JDL A IUUQIPXUPOPEFPSHVOEFSTUBOEJOHQSPDFTTOFYUUJDL w OPEFWͰ͸EP4PNFUIJOHͷ ऴ͕ྃQSPDFTTOFYU5JDLΑΓ଎ ͘ऴΘΔࣄ͕͋Δ w OPEFWҎ߱͸ؾʹ͢Δ͸ඞ ཁͳ͍
  6. ͦΕԿ͔ศརͳΜͰ͔͢ʁ WBSFOFX.Z&WFOU&NJUUFS  ! FPO TUBSU GVODUJPO \ DPOTPMFMPH TUBSU

     ^  ! FPO EBUB GVODUJPO \ DPOTPMFMPH EBUB  ^  FNJU bTUBSU` ͕OFYU5JDL͞Ε͍ͯΔͷͰɺFPO bTUBSU` ΛίϯετϥΫλͷޙ͔Βݺ ΜͰ΋FPO͕ઌʹ࣮ߦ͞ΕΔɻ
  7. ࠷ॳͷ࣮ݧͰ֬ೝ͠·ͨ͠ OPEFW W OPEFBKT CFHJO FOE OPEF XBSOJOH3FDVSTJWFQSPDFTTOFYU5JDLEFUFDUFE5IJTXJMMCSFBLJOUIFOFYUWFSTJPOPGOPEF 1MFBTFVTFTFU*NNFEJBUFGPSSFDVSTJWFEFGFSSBM 

    OPEF XBSOJOH3FDVSTJWFQSPDFTTOFYU5JDLEFUFDUFE5IJTXJMMCSFBLJOUIFOFYUWFSTJPOPGOPEF 1MFBTFVTFTFU*NNFEJBUFGPSSFDVSTJWFEFGFSSBM ! 3BOHF&SSPS.BYJNVNDBMMTUBDLTJ[FFYDFFEFE QSPDFTTOFYU5JDL͕શ෦࣮ߦ͞ΕΔͷͰɺ TFU5JNFPVU͕ಈ͔ͳ͍
  8. OFYU5JDL͸༻๏༻ྔΛकͬͯ ਖ਼͓͘͠࢖͍͍ͩ͘͞ w WҎ߱͸͍͍ͩͨಉ͡ɻ w ίϯςΩετ͕ऴΘ͔ͬͯΒ࣮ߦ͍ͨ͠ॲཧΛOFYU5JDL͔Βݺͼग़͢ɻ͙͢ ׬ྃ͢ΔFNJUͱ͔ɻ w ࠶ؼ͢ΔͳΒTFU*NNFEJBUFͰɻ w

    ඇಉظͬΆ͍ΠϯλϑΣʔεͷಉظॲཧͰOFYU5JDL͢Δͱຊ౰ʹඇಉظʹͳ Δɻ w TFU5JNFPVU GVODUJPO  ʹରͯ͠OFYU5JDL͸ഒ͙Β͍଎͍ɻIUUQT HJTUHJUIVCDPNNNBMFDLJ w /PEFKTJT$BODFSʹର͢ΔOFYU5JDLʹΑΔղˠ'BTUOPOCMPDLJOH pCPOBDDJTFSWFSIUUQTHJUIVCDPNHMFOKBNJOOPEFpC
  9. WͷΠϕϯτϧ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