[DiscordArchive] how many threads can update _cacheState ? 1 or more ?
[DiscordArchive] how many threads can update _cacheState ? 1 or more ?
Archived author: Tea • Posted: 2024-07-17T20:18:16.867000+00:00
Original source
but this is stupid
Archived author: Tea • Posted: 2024-07-17T20:18:39.129000+00:00
Original source
std::future destructor will block if it was obtained by using std::async...
Archived author: Tea • Posted: 2024-07-17T20:18:42.645000+00:00
Original source
https://en.cppreference.com/w/cpp/thread.../%7Efuture
[Embed: cpp/thread/future/~future]
https://en.cppreference.com/w/cpp/thread.../%7Efuture
Archived author: Foe • Posted: 2024-07-17T20:18:47.303000+00:00
Original source
Yeah
Archived author: Foe • Posted: 2024-07-17T20:20:26.951000+00:00
Original source
So the only "*good*" solution I could find was to either do it like I did with detach, write a worker and wait in the deinit for a stop signal, or do some lambda black magic that just looked cursed
Archived author: jackpoz • Posted: 2024-07-17T20:22:09.217000+00:00
Original source
isn't it enough to store the std::future in the class as a member ?
hared_future<void> and give to all the states that are going to be reloaded, replacing the bool reload member
Archived author: Tea • Posted: 2024-07-17T20:25:27.033000+00:00
Original source
if you were trying to be fancy, you would use std:
hared_future<void> and give to all the states that are going to be reloaded, replacing the bool reload member
Archived author: Tea • Posted: 2024-07-17T20:25:35.228000+00:00
Original source
feels overengineered
Archived author: Foe • Posted: 2024-07-17T20:25:54.818000+00:00
Original source
Yeah..
Archived author: Foe • Posted: 2024-07-17T20:33:07.405000+00:00
Original source
I'll probably try to play around with freezing the reload thread over the weekend and see if it crashes on shutdown, pretty sure it will