[DiscordArchive] why is there a thread handling mail expirations?
[DiscordArchive] why is there a thread handling mail expirations?
Archived author: Takenbacon • Posted: 2024-11-11T10:58:21.801000+00:00
Original source
why is there a thread handling mail expirations?
Archived author: andriuspel • Posted: 2024-11-11T10:58:26.196000+00:00
Original source
shared_ptr has atomic security model, where memory is deleted only when last reference is deleted
Archived author: walkline • Posted: 2024-11-11T10:59:06.944000+00:00
Original source
That would make sense if we had several threads interacting with mail (like mail expiration thread). But my assumption is that all mail-related logic is handled only in the world thread, so there are no concurrent interactions — no issues.
Archived author: andriuspel • Posted: 2024-11-11T11:04:12.100000+00:00
Original source
but lets say, item is removed by other threads or processes, lets say you make handling item destruction case, you go to vendor, you trigger item repair, such item may has limited timed duration, and item gets removed during repair/enchant process
Archived author: andriuspel • Posted: 2024-11-11T11:04:55.546000+00:00
Original source
and before applying repair/enchant tasks, item could be gone
Archived author: andriuspel • Posted: 2024-11-11T11:05:04.481000+00:00
Original source
while task gets triggered
Archived author: andriuspel • Posted: 2024-11-11T11:07:00.706000+00:00
Original source
or lets say, what if item is deleted outside of world thread
Archived author: andriuspel • Posted: 2024-11-11T11:07:35.395000+00:00
Original source
lets say, direct call from spell effects
Archived author: walkline • Posted: 2024-11-11T11:17:27.317000+00:00
Original source
I think you are overestimating concurrency in AC. There are not that many parallel things that can happen. I believe a situation like the one you described is still handled in the same thread and isn't concurrent.
Archived author: andriuspel • Posted: 2024-11-11T11:19:24.048000+00:00
Original source
this pretty much mainly can happen in ahbot, if you set 1k+ items and very short mail expiration time