cinera_handmade.network/cmuratori/hero/code/code122.hmml

63 lines
4.1 KiB
Plaintext
Raw Normal View History

[video member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Introduction to Multithreading" vod_platform=youtube id=qkugPXGeX58 annotator=Miblo]
[2:50][Blackboard: Multithreading]
[3:35][Blackboard: CPU state]
[5:08][Blackboard: How the OS conceptualises this]
[6:55][Blackboard: Threads]
[8:24][Blackboard: Fibers]
[9:38][Blackboard: Why do we care about this?]
[12:10][Blackboard: "Core"]
[14:16][Blackboard: "Hyperthread"]
[18:16][Blackboard: The OS comes in and switches]
[19:40][Blackboard: Logical cores]
[22:33][Blackboard: "Out of order" vs "In order"]
[24:08][Blackboard: The OS and "interrupts"]
[27:59][Blackboard: "Preemption"]
[30:17][Blackboard: What we have to do on Handmade Hero]
[32:11][Run Handmade Hero and monitor its CPU usage]
[34:41][Switch to DrawRectangleSlowly]
[37:11][Blackboard: Why not do faster single-threaded processing?]
[40:47][Set the stage to create some threads]
[43:27][win32_handmade.cpp: Introduce CreateThread[ref
site="MSDN"
page="CreateThread function"
url=https://msdn.microsoft.com/en-us/library/windows/desktop/ms682453][ref
site="MSDN"
page="ThreadProc callback function"
url=https://msdn.microsoft.com/en-us/library/windows/desktop/ms686736]]
[49:29][Run the code and exit]
[50:15][Temporarily create lots of threads]
[50:46][Solidify things[ref
site=MSDN
page="ResumeThread function"
url=https://msdn.microsoft.com/en-us/library/windows/desktop/ms685086][ref
site=MSDN
page="CloseHandle function"
url=https://msdn.microsoft.com/en-us/library/windows/desktop/ms724211]]
[53:14][What happens on exit[ref
site=MSDN
page="ExitProcess function"
url=https://msdn.microsoft.com/en-us/library/windows/desktop/ms682658]]
[57:27][Hype up building without CRT]
[58:36][The compiler doesn't know about threading]
[1:00:03][Q&A][:speech]
[1:00:27][@knozza][What does closing the handle of a thread do for you when you release the handle to the OS? Does it open up resources and increase performance?]
[1:01:32][@woodkami][Doesn't increasing the number of threads to match the hyperthreads count increase cross-core/cross-context switches, thus making it less efficient for small operations?]
[1:03:21][@microhive][Is there any advantage to creating a separate process to render the graphics in the context of game development?]
[1:04:58][@Miblo][Is it still a while yet before we look at other platform layers than win32?]
[1:05:31][@deepmist][Why just 15 threads? Why not future proof?]
[1:06:19][@justy989][Will we be querying the system for its CPU count to determine how many threads to use?]
[1:06:28][@BrainCruser][Do you have control over on which core the thread executes from the program itself (thread affinity)?]
[1:07:57][@moreaxes][Do you plan to make path-finding multithreaded?]
[1:08:25][@abnercoimbre][Q: Jonathan Blow had created 10,000 threads on his compiler demo. Some people wondered how in the world that could happen]
[1:09:53][@garlandobloom][No one will ever need more than 16 threads]
[1:10:05][@d7samurai][Nobody will ever need more than 256 colors. Ever. - the GIF committee]
[1:10:51][@zarickan][Not related, but why do you use C over C++? Is it just personal preference?]
[1:12:11][@kknewkles][Okay. Can we stay on stream after you end the episode's recording for another try on the story?]
[1:12:20][@kknewkles][I'll email you the story, meanwhile, here's two other questions: 1) Which programmers' code would you recommend reading? Let's list Sean Barrett's public github (as well as streams from time to time) to start the list]
[1:12:48][@kknewkles][2) When are we covering patching / couple of words on brief basics? I assume it mostly has to deal with asset updates and updates of code that handles them?]
[1:14:20][@wofiel][What was the reason for dismissing the use of fibers early on?]
[1:14:58][@maudrid][Have you made any progress on the licence text for ports to other programming languages?]
[1:16:10][@theepsylon][Would it be possible for you to boost the sound of your voice on stream? I've always found that it is barely high enough even with all mixers at maximum volume possible]
[1:16:39][Wrap things up]
[/video]