[DiscordArchive] why is there a thread handling mail expirations?
[DiscordArchive] why is there a thread handling mail expirations?
Archived author: andriuspel • Posted: 2024-11-11T11:23:07.950000+00:00
Original source
that "self destruction" call is most dangerious for now
Archived author: Takenbacon • Posted: 2024-11-11T11:29:54.686000+00:00
Original source
sounds about right considering it was just discussed that the current AH threading model is bad and unsafe. slapping a shared_ptr on items is attempting to address a symptom and not the actual problem
Archived author: andriuspel • Posted: 2024-11-11T11:35:42.359000+00:00
Original source
its not like i'm trying to hide, simply shared_ptr was designed for such cases, to avoid deallocation, memory corruption cases easier, since shared_ptr has atomic counter and when counter hits 0, object memory is removed
Archived author: andriuspel • Posted: 2024-11-11T11:36:08.414000+00:00
Original source
also shared_ptr is meant for shared ownership
Archived author: andriuspel • Posted: 2024-11-11T11:36:49.569000+00:00
Original source
unique_ptr differs mainly that it can hold only single object entry and can be only one unique object
Archived author: andriuspel • Posted: 2024-11-11T11:38:35.395000+00:00
Original source
there is possible to use mutexes or other methods, or maybe even same lambda with item capture events
Archived author: andriuspel • Posted: 2024-11-11T11:39:17.494000+00:00
Original source
value locking methods are not safe in general
Archived author: andriuspel • Posted: 2024-11-11T11:41:11.410000+00:00
Original source
and weak_ptr is like, shared_ptr locker, it can lock shared_ptr pointer before actual object removal (aka, before counter hits 0)
Archived author: walkline • Posted: 2024-11-11T11:50:07.729000+00:00
Original source
Well, I think Takenbacon and I are not against smart pointers in general. Refactoring to use smart pointers in some places isn't a bad idea. But if we are talking about this in the context of fixing things with smart pointers, there are not that many issues (at least not that I'm aware of) that are actually broken. This auction issue is more like an exception and it's definitely broken, and using smart pointers alone isn't enough to fix it.
Archived author: andriuspel • Posted: 2024-11-11T11:54:33.580000+00:00
Original source
there could be other way around - refactor item removal queue