|
Matthew Zimmerman |
at Jun 29, 2015 at 11:59 am
|
⇧ |
| |
It's not possible exactly as you've described, but I've tackled this
problem by splitting out the entities in the map with a hash %
runtime.NumCPU()
http://play.golang.org/p/c4yTgmcQHIThis will use more memory, but now you should achieve almost 100 % cpu
utilization even with a map based data structure storing the data.
On Mon, Jun 29, 2015 at 7:28 AM Volker Dobler wrote:Am Montag, 29. Juni 2015 13:18:03 UTC+2 schrieb DM:
Right now it seems if a lock is done before setting a value in a map then
it seems the entire map is locked preventing write to some other keys as
well.
[...]Is it possible to do a lock only at the key level(using any sync
mechanism or using some additional data-structure for keys) in any look-up
data structure so that writing to some other keys other than the one in
which lock is held can proceed without getting blocked?
No it is not possible.
V.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit
https://groups.google.com/d/optout. --
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit
https://groups.google.com/d/optout.