Changes

Jump to: navigation, search

Shared Hash Table

No change in size, 22:24, 18 May 2018
m
no edit summary
One common solution to avoid such errors is [https://en.wikipedia.org/wiki/Synchronization_%28computer_science%29 synchronization] using [https://en.wikipedia.org/wiki/Lock_%28computer_science%29 atomic locks], and to implement a [https://en.wikipedia.org/wiki/Critical_section critical section] or [https://en.wikipedia.org/wiki/Mutual_exclusion mutual exclusion].
===CilkchessCilkChess===As an example, [[CilkchessCilkChess]] used [[Cilk|Cilk's]] support for atomicity <ref>[[Don Dailey]], [[Charles Leiserson|Charles E. Leiserson]] ('''2001'''). ''Using Cilk to Write Multiprocessor Chess Programs''. [[Advances in Computer Games 9]], [http://supertech.csail.mit.edu/papers/icca99.pdf pdf], 5 Other parallel programming issues, Cilk support for atomicity, pp. 17-18</ref>. It uses one lock per hash entry:
<pre>
typedef struct
===Granularity===
An important property of a lock is its [https://en.wikipedia.org/wiki/Lock_%28computer_science%29#Granularity granularity], which is a measure of the amount of data the lock is protecting. In general, choosing a coarse granularity (a small number of locks, each protecting a large segment of data) results in less lock overhead when a single process is accessing the protected data, but worse performance when multiple processes are running concurrently. This is because of increased lock contention. The more coarse the lock, the higher the likelihood that the lock will stop an unrelated process from proceeding, i.e. in the extreme case, one lock for the whole table. Conversely, using a fine granularity (a larger number of locks, each protecting a fairly small amount of data), like in the Cilkchess CilkChess sample above, increases the overhead of the locks themselves but reduces lock contention. For a huge transposition table with millions of fairly small entries locks incur a significant performance penalty on many architectures.
<span id="Lockless"></span>
==Lock-less==

Navigation menu