arades79 / hyperdome

the safest place to reach out
Other
27 stars 1 forks source link

Use Queues for server message lists to ensure ordering and synchronization #100

Closed arades79 closed 1 year ago

arades79 commented 4 years ago

Currently messages are stored in a simple list, which is appended to and popped from by the server in multiple threads. Although unlikely due to only one person adding and one person reading from the message list, all server actions are handled in independent threads and message ordering is critical to chat integrity. A race condition, which a queue would prevent, will prevent some possible cases where a message is read twice causing an error.

arades79 commented 1 year ago

Queues not strictly necessary. Locking should be used when editing global dictionary items.

Overview of planned server data: