Handmade Hero»Episode Guide
Fixing an Asset System Thread Bug
?
?

Keyboard Navigation

Global Keys

[, < / ], > Jump to previous / next episode
W, K, P / S, J, N Jump to previous / next marker
t / T Toggle theatre / SUPERtheatre mode
V Revert filter to original state Y Select link (requires manual Ctrl-c)

Menu toggling

q Quotes r References f Filter y Link c Credits

In-Menu Movement

a
w
s
d
h j k l


Quotes and References Menus

Enter Jump to timecode

Quotes, References and Credits Menus

o Open URL (in new tab)

Filter Menu

x, Space Toggle category and focus next
X, ShiftSpace Toggle category and focus previous
v Invert topics / media as per focus

Filter and Link Menus

z Toggle filter / linking mode

Credits Menu

Enter Open URL (in new tab)
0:50Two possible plans for today:
0:50Two possible plans for today:
0:50Two possible plans for today:
1:01a) Construction of sentences and paragraphs
1:01a) Construction of sentences and paragraphs
1:01a) Construction of sentences and paragraphs
2:09b) Fixing a bug. Let's fix the bug
2:09b) Fixing a bug. Let's fix the bug
2:09b) Fixing a bug. Let's fix the bug
3:43Explanation of the bug
3:43Explanation of the bug
3:43Explanation of the bug
5:58How does the bug happen and how should we fix it?
5:58How does the bug happen and how should we fix it?
5:58How does the bug happen and how should we fix it?
7:53One approach: Marking assets as used or not used
7:53One approach: Marking assets as used or not used
7:53One approach: Marking assets as used or not used
8:29Cons of asset locking
8:29Cons of asset locking
8:29Cons of asset locking
9:34Blackboard brainstorming
9:34Blackboard brainstorming
9:34Blackboard brainstorming
10:04In-flight asset protection
10:04In-flight asset protection
10:04In-flight asset protection
11:13Usage patterns of assets
11:13Usage patterns of assets
11:13Usage patterns of assets
13:21Keeping an asset usage count and its associated problems
13:21Keeping an asset usage count and its associated problems
13:21Keeping an asset usage count and its associated problems
16:05Introducing render_group generation IDs
16:05Introducing render_group generation IDs
16:05Introducing render_group generation IDs
20:02Cons of this approach: Possible wrapping of the IDs
20:02Cons of this approach: Possible wrapping of the IDs
20:02Cons of this approach: Possible wrapping of the IDs
21:44Maybe the wrapping is not a problem, after all
21:44Maybe the wrapping is not a problem, after all
21:44Maybe the wrapping is not a problem, after all
23:14Some other complications of this approach
23:14Some other complications of this approach
23:14Some other complications of this approach
27:14Feasibility of using generation IDs given the current state of our asset system code
27:14Feasibility of using generation IDs given the current state of our asset system code
27:14Feasibility of using generation IDs given the current state of our asset system code
30:45Generation IDs make MoveHeaderToFront superfluous
30:45Generation IDs make MoveHeaderToFront superfluous
30:45Generation IDs make MoveHeaderToFront superfluous
32:00Doubly-linked lists and threading don't play well
32:00Doubly-linked lists and threading don't play well
32:00Doubly-linked lists and threading don't play well
35:58Blackboard explanation of some problems we will encounter
35:58Blackboard explanation of some problems we will encounter
35:58Blackboard explanation of some problems we will encounter
37:29One possible solution: Queuing our MoveHeaderToFronts so that only one thread performs them
37:29One possible solution: Queuing our MoveHeaderToFronts so that only one thread performs them
37:29One possible solution: Queuing our MoveHeaderToFronts so that only one thread performs them
39:02Another solution: Lock-free heap data structure
39:02Another solution: Lock-free heap data structure
39:02Another solution: Lock-free heap data structure
39:59Yet another idea... that also poses some problems
39:59Yet another idea... that also poses some problems
39:59Yet another idea... that also poses some problems
42:48We could also sort the generation ID-asset pairs separately
42:48We could also sort the generation ID-asset pairs separately
42:48We could also sort the generation ID-asset pairs separately
46:20How about a multithreaded heap?
46:20How about a multithreaded heap?
46:20How about a multithreaded heap?
48:22Coding the "generation IDs" approach
48:22Coding the "generation IDs" approach
48:22Coding the "generation IDs" approach
55:28Updating the GenerationID
55:28Updating the GenerationID
55:28Updating the GenerationID
57:24Compressing GetBitmap and GetSound together
57:24Compressing GetBitmap and GetSound together
57:24Compressing GetBitmap and GetSound together
1:01:50Leaving the code in a working state (although we are still not finished)
1:01:50Leaving the code in a working state (although we are still not finished)
1:01:50Leaving the code in a working state (although we are still not finished)
1:03:57Q&A
🗩
1:03:57Q&A
🗩
1:03:57Q&A
🗩
1:04:52Sharlock93 Hey Casey, can you do a 2-min recap of everything done today?
🗪
1:04:52Sharlock93 Hey Casey, can you do a 2-min recap of everything done today?
🗪
1:04:52Sharlock93 Hey Casey, can you do a 2-min recap of everything done today?
🗪
1:07:49andsz_ How often do you actually implement something from a paper?
🗪
1:07:49andsz_ How often do you actually implement something from a paper?
🗪
1:07:49andsz_ How often do you actually implement something from a paper?
🗪
1:08:45SvK151 What would be the worst case scenario if you had multiple threads trying to remove an asset? Couldn't you just wait till no thread was trying to remove the asset?
🗪
1:08:45SvK151 What would be the worst case scenario if you had multiple threads trying to remove an asset? Couldn't you just wait till no thread was trying to remove the asset?
🗪
1:08:45SvK151 What would be the worst case scenario if you had multiple threads trying to remove an asset? Couldn't you just wait till no thread was trying to remove the asset?
🗪
1:09:14Pseudonym73 One way to avoid the lock is to split the LRU list into two parts. Keep the most recent 25% of it in one partition and the least recent 75% in another. Only move an asset to the head of the list if it's in the least recent part
🗪
1:09:14Pseudonym73 One way to avoid the lock is to split the LRU list into two parts. Keep the most recent 25% of it in one partition and the least recent 75% in another. Only move an asset to the head of the list if it's in the least recent part
🗪
1:09:14Pseudonym73 One way to avoid the lock is to split the LRU list into two parts. Keep the most recent 25% of it in one partition and the least recent 75% in another. Only move an asset to the head of the list if it's in the least recent part
🗪
1:09:54JamesWidman So IIUC, our problem is that "least recently used", in this context, means "least-recently-stopped-being-used-in-all-threads", and we can't really know that for certain without having some form of inter-thread communication.... Is that correct?
🗪
1:09:54JamesWidman So IIUC, our problem is that "least recently used", in this context, means "least-recently-stopped-being-used-in-all-threads", and we can't really know that for certain without having some form of inter-thread communication.... Is that correct?
🗪
1:09:54JamesWidman So IIUC, our problem is that "least recently used", in this context, means "least-recently-stopped-being-used-in-all-threads", and we can't really know that for certain without having some form of inter-thread communication.... Is that correct?
🗪
1:10:43Meathead protein-powder actionα
1:10:43Meathead protein-powder actionα
1:10:43Meathead protein-powder actionα
1:13:18Pseudonym73 You don't take the lock on hot assets most of the time
🗪
1:13:18Pseudonym73 You don't take the lock on hot assets most of the time
🗪
1:13:18Pseudonym73 You don't take the lock on hot assets most of the time
🗪
1:14:14Sharlock93 I haven't seen you drink any milk this stream, is that why you are tired?!
🗪
1:14:14Sharlock93 I haven't seen you drink any milk this stream, is that why you are tired?!
🗪
1:14:14Sharlock93 I haven't seen you drink any milk this stream, is that why you are tired?!
🗪
1:14:56EzyFool You can avoid the genid gap checking list by keeping min/max/cnt rendergroup "done" ids, and freeing all assets <max when cnt = max - min, then reset min=max. Not the best if you want to free ASAP all the time. and the window gets large
🗪
1:14:56EzyFool You can avoid the genid gap checking list by keeping min/max/cnt rendergroup "done" ids, and freeing all assets <max when cnt = max - min, then reset min=max. Not the best if you want to free ASAP all the time. and the window gets large
🗪
1:14:56EzyFool You can avoid the genid gap checking list by keeping min/max/cnt rendergroup "done" ids, and freeing all assets <max when cnt = max - min, then reset min=max. Not the best if you want to free ASAP all the time. and the window gets large
🗪
1:17:45EzyFool You know the min rendergroup that completed, but like you mentioned at the start, if they complete out of order, the min isn't...
🗪
1:17:45EzyFool You know the min rendergroup that completed, but like you mentioned at the start, if they complete out of order, the min isn't...
🗪
1:17:45EzyFool You know the min rendergroup that completed, but like you mentioned at the start, if they complete out of order, the min isn't...
🗪
1:18:31EzyFool ...correct when a gap occurs, so you need to track the interval and jump ahead when it fills. But maybe I'm just misunderstanding the situation
🗪
1:18:31EzyFool ...correct when a gap occurs, so you need to track the interval and jump ahead when it fills. But maybe I'm just misunderstanding the situation
🗪
1:18:31EzyFool ...correct when a gap occurs, so you need to track the interval and jump ahead when it fills. But maybe I'm just misunderstanding the situation
🗪
1:19:40Vargolindo I'm at the Day 19 video (improving audio sync) and in order to get timeBeginPeriod to work I had to call it twice. Do you have any idea why?
🗪
1:19:40Vargolindo I'm at the Day 19 video (improving audio sync) and in order to get timeBeginPeriod to work I had to call it twice. Do you have any idea why?
🗪
1:19:40Vargolindo I'm at the Day 19 video (improving audio sync) and in order to get timeBeginPeriod to work I had to call it twice. Do you have any idea why?
🗪
1:21:07hitmanatee Any update on what algorithm you are using to do laundry these days?
🗪
1:21:07hitmanatee Any update on what algorithm you are using to do laundry these days?
🗪
1:21:07hitmanatee Any update on what algorithm you are using to do laundry these days?
🗪
1:21:50EzyFool Never mind, my keyboard & my internet seem to be dying, I'll wait 'til tomorrow
🗪
1:21:50EzyFool Never mind, my keyboard & my internet seem to be dying, I'll wait 'til tomorrow
🗪
1:21:50EzyFool Never mind, my keyboard & my internet seem to be dying, I'll wait 'til tomorrow
🗪
1:22:11Sharlock93 I think we should do a detour and make a simple ray tracer
🗪
1:22:11Sharlock93 I think we should do a detour and make a simple ray tracer
🗪
1:22:11Sharlock93 I think we should do a detour and make a simple ray tracer
🗪
1:22:43Wind it down
🗩
1:22:43Wind it down
🗩
1:22:43Wind it down
🗩