mochi / mochiweb

MochiWeb is an Erlang library for building lightweight HTTP servers.
Other
1.86k stars 474 forks source link

question about mochiglobal #170

Closed WanliTian closed 8 years ago

WanliTian commented 8 years ago

if i have one process to update values maintained by mochiglobal for every one minute, and hundreds of processes to access these value with mochiglobal. Is it save to these reading processes?

etrepum commented 8 years ago

I am not sure what you mean exactly, but the use case for mochiglobal is to share infrequently updated data across processes. Once a minute is probably not a bottleneck, but there is some synchronization in Erlang code loading so you should always profile to make sure that the variance is acceptable during that reloading window. If the data is not large, ets may be a better solution.