FAQ
Thanks Volker and Matthew.
On Mon, Jun 29, 2015 at 5:29 PM, Matthew Zimmerman wrote:

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/c4yTgmcQHI

This 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 a topic in the
Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/golang-nuts/0XQpzO3obdc/unsubscribe.
To unsubscribe from this group and all its topics, 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.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 4 of 5 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedJun 29, '15 at 11:18a
activeJun 30, '15 at 5:17a
posts5
users4
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase