aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Houchard <cognet@FreeBSD.org>2016-11-28 20:08:52 +0000
committerOlivier Houchard <cognet@FreeBSD.org>2016-11-28 20:08:52 +0000
commit85bd1e2d0af14ce6dfa00ef86745a52c0b500ca5 (patch)
treecd409659d3827b3b1c810ebd9d629408d14696f2
downloadsrc-85bd1e2d0af14ce6dfa00ef86745a52c0b500ca5.tar.gz
src-85bd1e2d0af14ce6dfa00ef86745a52c0b500ca5.zip
Import concurrencykit as of commit 566bb28dba963a1904e0889b74fe7005a5bc5eb8
Notes
Notes: svn path=/vendor-sys/ck/dist/; revision=309260
-rw-r--r--LICENSE54
-rw-r--r--Makefile.in103
-rw-r--r--README21
-rw-r--r--build/ck.build.aarch641
-rw-r--r--build/ck.build.arm1
-rw-r--r--build/ck.build.in10
-rw-r--r--build/ck.build.ppc1
-rw-r--r--build/ck.build.ppc642
-rw-r--r--build/ck.build.sparcv91
-rw-r--r--build/ck.build.x862
-rw-r--r--build/ck.build.x86_642
-rw-r--r--build/ck.pc.in10
-rw-r--r--build/ck.spec.in74
-rw-r--r--build/regressions.build.in10
-rwxr-xr-xconfigure775
-rw-r--r--doc/CK_ARRAY_FOREACH79
-rw-r--r--doc/CK_COHORT_INIT66
-rw-r--r--doc/CK_COHORT_INSTANCE59
-rw-r--r--doc/CK_COHORT_LOCK61
-rw-r--r--doc/CK_COHORT_PROTOTYPE76
-rw-r--r--doc/CK_COHORT_TRYLOCK69
-rw-r--r--doc/CK_COHORT_TRYLOCK_PROTOTYPE90
-rw-r--r--doc/CK_COHORT_UNLOCK61
-rw-r--r--doc/CK_HS_HASH71
-rw-r--r--doc/CK_RHS_HASH71
-rw-r--r--doc/CK_RWCOHORT_INIT61
-rw-r--r--doc/CK_RWCOHORT_INSTANCE64
-rw-r--r--doc/CK_RWCOHORT_PROTOTYPE65
-rw-r--r--doc/CK_RWCOHORT_READ_LOCK66
-rw-r--r--doc/CK_RWCOHORT_READ_UNLOCK65
-rw-r--r--doc/CK_RWCOHORT_WRITE_LOCK66
-rw-r--r--doc/CK_RWCOHORT_WRITE_UNLOCK65
-rw-r--r--doc/Makefile.in218
-rw-r--r--doc/ck_array_buffer60
-rw-r--r--doc/ck_array_commit58
-rw-r--r--doc/ck_array_deinit62
-rw-r--r--doc/ck_array_init69
-rw-r--r--doc/ck_array_initialized62
-rw-r--r--doc/ck_array_length57
-rw-r--r--doc/ck_array_put65
-rw-r--r--doc/ck_array_put_unique67
-rw-r--r--doc/ck_array_remove64
-rw-r--r--doc/ck_bitmap_base58
-rw-r--r--doc/ck_bitmap_bits56
-rw-r--r--doc/ck_bitmap_bts61
-rw-r--r--doc/ck_bitmap_buffer65
-rw-r--r--doc/ck_bitmap_clear56
-rw-r--r--doc/ck_bitmap_init84
-rw-r--r--doc/ck_bitmap_iterator_init70
-rw-r--r--doc/ck_bitmap_next90
-rw-r--r--doc/ck_bitmap_reset57
-rw-r--r--doc/ck_bitmap_set57
-rw-r--r--doc/ck_bitmap_size62
-rw-r--r--doc/ck_bitmap_test62
-rw-r--r--doc/ck_bitmap_union58
-rw-r--r--doc/ck_brlock121
-rw-r--r--doc/ck_cohort211
-rw-r--r--doc/ck_elide252
-rw-r--r--doc/ck_epoch_barrier120
-rw-r--r--doc/ck_epoch_begin73
-rw-r--r--doc/ck_epoch_call136
-rw-r--r--doc/ck_epoch_end64
-rw-r--r--doc/ck_epoch_init69
-rw-r--r--doc/ck_epoch_poll71
-rw-r--r--doc/ck_epoch_reclaim92
-rw-r--r--doc/ck_epoch_recycle102
-rw-r--r--doc/ck_epoch_register67
-rw-r--r--doc/ck_epoch_synchronize119
-rw-r--r--doc/ck_epoch_unregister65
-rw-r--r--doc/ck_hs_apply86
-rw-r--r--doc/ck_hs_count70
-rw-r--r--doc/ck_hs_destroy77
-rw-r--r--doc/ck_hs_fas98
-rw-r--r--doc/ck_hs_gc88
-rw-r--r--doc/ck_hs_get88
-rw-r--r--doc/ck_hs_grow81
-rw-r--r--doc/ck_hs_init169
-rw-r--r--doc/ck_hs_iterator_init78
-rw-r--r--doc/ck_hs_move90
-rw-r--r--doc/ck_hs_next92
-rw-r--r--doc/ck_hs_put98
-rw-r--r--doc/ck_hs_put_unique98
-rw-r--r--doc/ck_hs_rebuild76
-rw-r--r--doc/ck_hs_remove92
-rw-r--r--doc/ck_hs_reset77
-rw-r--r--doc/ck_hs_reset_size80
-rw-r--r--doc/ck_hs_set102
-rw-r--r--doc/ck_hs_stat81
-rw-r--r--doc/ck_ht_count77
-rw-r--r--doc/ck_ht_destroy87
-rw-r--r--doc/ck_ht_entry_empty90
-rw-r--r--doc/ck_ht_entry_key88
-rw-r--r--doc/ck_ht_entry_key_direct91
-rw-r--r--doc/ck_ht_entry_key_length88
-rw-r--r--doc/ck_ht_entry_key_set93
-rw-r--r--doc/ck_ht_entry_key_set_direct88
-rw-r--r--doc/ck_ht_entry_set95
-rw-r--r--doc/ck_ht_entry_set_direct94
-rw-r--r--doc/ck_ht_entry_value88
-rw-r--r--doc/ck_ht_entry_value_direct89
-rw-r--r--doc/ck_ht_gc96
-rw-r--r--doc/ck_ht_get_spmc177
-rw-r--r--doc/ck_ht_grow_spmc98
-rw-r--r--doc/ck_ht_hash90
-rw-r--r--doc/ck_ht_hash_direct90
-rw-r--r--doc/ck_ht_init188
-rw-r--r--doc/ck_ht_iterator_init88
-rw-r--r--doc/ck_ht_next107
-rw-r--r--doc/ck_ht_put_spmc146
-rw-r--r--doc/ck_ht_remove_spmc117
-rw-r--r--doc/ck_ht_reset_size_spmc84
-rw-r--r--doc/ck_ht_reset_spmc81
-rw-r--r--doc/ck_ht_set_spmc140
-rw-r--r--doc/ck_ht_stat85
-rw-r--r--doc/ck_pflock95
-rw-r--r--doc/ck_pr71
-rw-r--r--doc/ck_pr_add93
-rw-r--r--doc/ck_pr_and93
-rw-r--r--doc/ck_pr_barrier66
-rw-r--r--doc/ck_pr_btc90
-rw-r--r--doc/ck_pr_btr90
-rw-r--r--doc/ck_pr_bts90
-rw-r--r--doc/ck_pr_cas147
-rw-r--r--doc/ck_pr_dec124
-rw-r--r--doc/ck_pr_faa99
-rw-r--r--doc/ck_pr_fas100
-rw-r--r--doc/ck_pr_fence_acquire72
-rw-r--r--doc/ck_pr_fence_atomic111
-rw-r--r--doc/ck_pr_fence_atomic_load108
-rw-r--r--doc/ck_pr_fence_atomic_store109
-rw-r--r--doc/ck_pr_fence_load113
-rw-r--r--doc/ck_pr_fence_load_atomic113
-rw-r--r--doc/ck_pr_fence_load_depends75
-rw-r--r--doc/ck_pr_fence_load_store113
-rw-r--r--doc/ck_pr_fence_memory113
-rw-r--r--doc/ck_pr_fence_release71
-rw-r--r--doc/ck_pr_fence_store112
-rw-r--r--doc/ck_pr_fence_store_atomic108
-rw-r--r--doc/ck_pr_fence_store_load107
-rw-r--r--doc/ck_pr_inc124
-rw-r--r--doc/ck_pr_load96
-rw-r--r--doc/ck_pr_neg122
-rw-r--r--doc/ck_pr_not92
-rw-r--r--doc/ck_pr_or93
-rw-r--r--doc/ck_pr_rtm112
-rw-r--r--doc/ck_pr_stall86
-rw-r--r--doc/ck_pr_store96
-rw-r--r--doc/ck_pr_sub93
-rw-r--r--doc/ck_pr_xor93
-rw-r--r--doc/ck_queue147
-rw-r--r--doc/ck_rhs_apply86
-rw-r--r--doc/ck_rhs_count70
-rw-r--r--doc/ck_rhs_destroy77
-rw-r--r--doc/ck_rhs_fas98
-rw-r--r--doc/ck_rhs_gc73
-rw-r--r--doc/ck_rhs_get88
-rw-r--r--doc/ck_rhs_grow81
-rw-r--r--doc/ck_rhs_init166
-rw-r--r--doc/ck_rhs_iterator_init78
-rw-r--r--doc/ck_rhs_move90
-rw-r--r--doc/ck_rhs_next92
-rw-r--r--doc/ck_rhs_put98
-rw-r--r--doc/ck_rhs_put_unique98
-rw-r--r--doc/ck_rhs_rebuild76
-rw-r--r--doc/ck_rhs_remove92
-rw-r--r--doc/ck_rhs_reset77
-rw-r--r--doc/ck_rhs_reset_size80
-rw-r--r--doc/ck_rhs_set102
-rw-r--r--doc/ck_rhs_set_load_factor72
-rw-r--r--doc/ck_rhs_stat80
-rw-r--r--doc/ck_ring_capacity58
-rw-r--r--doc/ck_ring_dequeue_spmc117
-rw-r--r--doc/ck_ring_dequeue_spsc115
-rw-r--r--doc/ck_ring_enqueue_spmc115
-rw-r--r--doc/ck_ring_enqueue_spmc_size127
-rw-r--r--doc/ck_ring_enqueue_spsc113
-rw-r--r--doc/ck_ring_enqueue_spsc_size128
-rw-r--r--doc/ck_ring_init62
-rw-r--r--doc/ck_ring_size55
-rw-r--r--doc/ck_ring_trydequeue_spmc126
-rw-r--r--doc/ck_rwcohort203
-rw-r--r--doc/ck_rwlock143
-rw-r--r--doc/ck_sequence144
-rw-r--r--doc/ck_spinlock259
-rw-r--r--doc/ck_swlock138
-rw-r--r--doc/ck_tflock95
-rwxr-xr-xdoc/refcheck.pl27
-rw-r--r--include/ck_array.h100
-rw-r--r--include/ck_backoff.h57
-rw-r--r--include/ck_barrier.h164
-rw-r--r--include/ck_bitmap.h515
-rw-r--r--include/ck_brlock.h279
-rw-r--r--include/ck_bytelock.h196
-rw-r--r--include/ck_cc.h180
-rw-r--r--include/ck_cohort.h161
-rw-r--r--include/ck_elide.h321
-rw-r--r--include/ck_epoch.h207
-rw-r--r--include/ck_fifo.h478
-rw-r--r--include/ck_hp.h121
-rw-r--r--include/ck_hp_fifo.h215
-rw-r--r--include/ck_hp_stack.h110
-rw-r--r--include/ck_hs.h134
-rw-r--r--include/ck_ht.h271
-rw-r--r--include/ck_limits.h48
-rw-r--r--include/ck_malloc.h39
-rw-r--r--include/ck_md.h.in57
-rw-r--r--include/ck_pflock.h142
-rw-r--r--include/ck_pr.h1211
-rw-r--r--include/ck_queue.h428
-rw-r--r--include/ck_rhs.h134
-rw-r--r--include/ck_ring.h656
-rw-r--r--include/ck_rwcohort.h317
-rw-r--r--include/ck_rwlock.h302
-rw-r--r--include/ck_sequence.h125
-rw-r--r--include/ck_spinlock.h61
-rw-r--r--include/ck_stack.h357
-rw-r--r--include/ck_stdbool.h31
-rw-r--r--include/ck_stddef.h31
-rw-r--r--include/ck_stdint.h34
-rw-r--r--include/ck_stdlib.h31
-rw-r--r--include/ck_string.h31
-rw-r--r--include/ck_swlock.h218
-rw-r--r--include/ck_tflock.h136
-rw-r--r--include/gcc/aarch64/ck_f_pr.h167
-rw-r--r--include/gcc/aarch64/ck_pr.h492
-rw-r--r--include/gcc/arm/ck_f_pr.h162
-rw-r--r--include/gcc/arm/ck_pr.h554
-rw-r--r--include/gcc/ck_cc.h142
-rw-r--r--include/gcc/ck_f_pr.h105
-rw-r--r--include/gcc/ck_pr.h295
-rw-r--r--include/gcc/ppc/ck_f_pr.h79
-rw-r--r--include/gcc/ppc/ck_pr.h327
-rw-r--r--include/gcc/ppc64/ck_f_pr.h97
-rw-r--r--include/gcc/ppc64/ck_pr.h421
-rw-r--r--include/gcc/sparcv9/ck_f_pr.h26
-rw-r--r--include/gcc/sparcv9/ck_pr.h228
-rw-r--r--include/gcc/x86/ck_f_pr.h152
-rw-r--r--include/gcc/x86/ck_pr.h390
-rw-r--r--include/gcc/x86_64/ck_f_pr.h202
-rw-r--r--include/gcc/x86_64/ck_pr.h573
-rw-r--r--include/gcc/x86_64/ck_pr_rtm.h109
-rw-r--r--include/spinlock/anderson.h167
-rw-r--r--include/spinlock/cas.h119
-rw-r--r--include/spinlock/clh.h122
-rw-r--r--include/spinlock/dec.h143
-rw-r--r--include/spinlock/fas.h118
-rw-r--r--include/spinlock/hclh.h145
-rw-r--r--include/spinlock/mcs.h155
-rw-r--r--include/spinlock/ticket.h296
-rw-r--r--regressions/Makefile128
-rw-r--r--regressions/Makefile.unsupported9
-rw-r--r--regressions/ck_array/validate/Makefile17
-rw-r--r--regressions/ck_array/validate/serial.c178
-rw-r--r--regressions/ck_backoff/validate/Makefile15
-rw-r--r--regressions/ck_backoff/validate/validate.c60
-rw-r--r--regressions/ck_barrier/benchmark/Makefile14
-rw-r--r--regressions/ck_barrier/benchmark/throughput.c136
-rw-r--r--regressions/ck_barrier/validate/Makefile34
-rw-r--r--regressions/ck_barrier/validate/barrier_centralized.c121
-rw-r--r--regressions/ck_barrier/validate/barrier_combining.c143
-rw-r--r--regressions/ck_barrier/validate/barrier_dissemination.c144
-rw-r--r--regressions/ck_barrier/validate/barrier_mcs.c131
-rw-r--r--regressions/ck_barrier/validate/barrier_tournament.c142
-rw-r--r--regressions/ck_bitmap/validate/Makefile17
-rw-r--r--regressions/ck_bitmap/validate/serial.c372
-rw-r--r--regressions/ck_brlock/benchmark/Makefile17
-rw-r--r--regressions/ck_brlock/benchmark/latency.c103
-rw-r--r--regressions/ck_brlock/benchmark/throughput.c164
-rw-r--r--regressions/ck_brlock/validate/Makefile17
-rw-r--r--regressions/ck_brlock/validate/validate.c155
-rw-r--r--regressions/ck_bytelock/benchmark/Makefile14
-rw-r--r--regressions/ck_bytelock/benchmark/latency.c99
-rw-r--r--regressions/ck_bytelock/validate/Makefile17
-rw-r--r--regressions/ck_bytelock/validate/validate.c166
-rw-r--r--regressions/ck_cohort/benchmark/Makefile17
-rw-r--r--regressions/ck_cohort/benchmark/ck_cohort.c8
-rw-r--r--regressions/ck_cohort/benchmark/throughput.c239
-rw-r--r--regressions/ck_cohort/ck_cohort.h35
-rw-r--r--regressions/ck_cohort/validate/Makefile17
-rw-r--r--regressions/ck_cohort/validate/validate.c205
-rw-r--r--regressions/ck_epoch/validate/Makefile42
-rw-r--r--regressions/ck_epoch/validate/ck_epoch_call.c64
-rw-r--r--regressions/ck_epoch/validate/ck_epoch_poll.c236
-rw-r--r--regressions/ck_epoch/validate/ck_epoch_section.c311
-rw-r--r--regressions/ck_epoch/validate/ck_epoch_section_2.c191
-rw-r--r--regressions/ck_epoch/validate/ck_epoch_synchronize.c249
-rw-r--r--regressions/ck_epoch/validate/ck_stack.c164
-rw-r--r--regressions/ck_epoch/validate/torture.c234
-rw-r--r--regressions/ck_fifo/benchmark/Makefile14
-rw-r--r--regressions/ck_fifo/benchmark/latency.c157
-rw-r--r--regressions/ck_fifo/validate/Makefile29
-rw-r--r--regressions/ck_fifo/validate/ck_fifo_mpmc.c168
-rw-r--r--regressions/ck_fifo/validate/ck_fifo_mpmc_iterator.c90
-rw-r--r--regressions/ck_fifo/validate/ck_fifo_spsc.c177
-rw-r--r--regressions/ck_fifo/validate/ck_fifo_spsc_iterator.c83
-rw-r--r--regressions/ck_hp/benchmark/Makefile17
-rw-r--r--regressions/ck_hp/benchmark/fifo_latency.c94
-rw-r--r--regressions/ck_hp/benchmark/stack_latency.c95
-rw-r--r--regressions/ck_hp/validate/Makefile33
-rw-r--r--regressions/ck_hp/validate/ck_hp_fifo.c187
-rw-r--r--regressions/ck_hp/validate/ck_hp_fifo_donner.c213
-rw-r--r--regressions/ck_hp/validate/ck_hp_stack.c165
-rw-r--r--regressions/ck_hp/validate/nbds_haz_test.c226
-rw-r--r--regressions/ck_hp/validate/serial.c127
-rw-r--r--regressions/ck_hs/benchmark/Makefile23
-rw-r--r--regressions/ck_hs/benchmark/apply.c260
-rw-r--r--regressions/ck_hs/benchmark/parallel_bytestring.c602
-rw-r--r--regressions/ck_hs/benchmark/serial.c517
-rw-r--r--regressions/ck_hs/validate/Makefile17
-rw-r--r--regressions/ck_hs/validate/serial.c315
-rw-r--r--regressions/ck_ht/benchmark/Makefile27
-rw-r--r--regressions/ck_ht/benchmark/parallel_bytestring.c559
-rw-r--r--regressions/ck_ht/benchmark/parallel_direct.c545
-rw-r--r--regressions/ck_ht/benchmark/serial.c387
-rw-r--r--regressions/ck_ht/validate/Makefile21
-rw-r--r--regressions/ck_ht/validate/serial.c309
-rw-r--r--regressions/ck_pflock/benchmark/Makefile17
-rw-r--r--regressions/ck_pflock/benchmark/latency.c72
-rw-r--r--regressions/ck_pflock/benchmark/throughput.c163
-rw-r--r--regressions/ck_pflock/validate/Makefile17
-rw-r--r--regressions/ck_pflock/validate/validate.c151
-rw-r--r--regressions/ck_pr/benchmark/Makefile21
-rw-r--r--regressions/ck_pr/benchmark/benchmark.h130
-rw-r--r--regressions/ck_pr/benchmark/ck_pr_cas_64.c16
-rw-r--r--regressions/ck_pr/benchmark/ck_pr_cas_64_2.c17
-rw-r--r--regressions/ck_pr/benchmark/ck_pr_fas_64.c17
-rw-r--r--regressions/ck_pr/benchmark/fp.c66
-rw-r--r--regressions/ck_pr/validate/Makefile84
-rw-r--r--regressions/ck_pr/validate/ck_pr_add.c151
-rw-r--r--regressions/ck_pr/validate/ck_pr_and.c147
-rw-r--r--regressions/ck_pr/validate/ck_pr_bin.c94
-rw-r--r--regressions/ck_pr/validate/ck_pr_btc.c96
-rw-r--r--regressions/ck_pr/validate/ck_pr_btr.c97
-rw-r--r--regressions/ck_pr/validate/ck_pr_bts.c97
-rw-r--r--regressions/ck_pr/validate/ck_pr_btx.c112
-rw-r--r--regressions/ck_pr/validate/ck_pr_cas.c158
-rw-r--r--regressions/ck_pr/validate/ck_pr_dec.c143
-rw-r--r--regressions/ck_pr/validate/ck_pr_faa.c152
-rw-r--r--regressions/ck_pr/validate/ck_pr_fas.c148
-rw-r--r--regressions/ck_pr/validate/ck_pr_fax.c121
-rw-r--r--regressions/ck_pr/validate/ck_pr_inc.c143
-rw-r--r--regressions/ck_pr/validate/ck_pr_load.c149
-rw-r--r--regressions/ck_pr/validate/ck_pr_n.c90
-rw-r--r--regressions/ck_pr/validate/ck_pr_or.c149
-rw-r--r--regressions/ck_pr/validate/ck_pr_store.c150
-rw-r--r--regressions/ck_pr/validate/ck_pr_sub.c151
-rw-r--r--regressions/ck_pr/validate/ck_pr_unary.c117
-rw-r--r--regressions/ck_pr/validate/ck_pr_xor.c147
-rw-r--r--regressions/ck_queue/validate/Makefile26
-rw-r--r--regressions/ck_queue/validate/ck_list.c236
-rw-r--r--regressions/ck_queue/validate/ck_slist.c217
-rw-r--r--regressions/ck_queue/validate/ck_stailq.c256
-rw-r--r--regressions/ck_rhs/benchmark/Makefile17
-rw-r--r--regressions/ck_rhs/benchmark/parallel_bytestring.c599
-rw-r--r--regressions/ck_rhs/benchmark/serial.c517
-rw-r--r--regressions/ck_rhs/validate/Makefile17
-rw-r--r--regressions/ck_rhs/validate/serial.c310
-rw-r--r--regressions/ck_ring/benchmark/Makefile14
-rw-r--r--regressions/ck_ring/benchmark/latency.c142
-rw-r--r--regressions/ck_ring/validate/Makefile40
-rw-r--r--regressions/ck_ring/validate/ck_ring_mpmc.c448
-rw-r--r--regressions/ck_ring/validate/ck_ring_mpmc_template.c349
-rw-r--r--regressions/ck_ring/validate/ck_ring_spmc.c340
-rw-r--r--regressions/ck_ring/validate/ck_ring_spmc_template.c350
-rw-r--r--regressions/ck_ring/validate/ck_ring_spsc.c213
-rw-r--r--regressions/ck_rwcohort/benchmark/Makefile32
-rw-r--r--regressions/ck_rwcohort/benchmark/ck_neutral.c7
-rw-r--r--regressions/ck_rwcohort/benchmark/ck_rp.c7
-rw-r--r--regressions/ck_rwcohort/benchmark/ck_wp.c7
-rw-r--r--regressions/ck_rwcohort/benchmark/latency.h106
-rw-r--r--regressions/ck_rwcohort/benchmark/throughput.h245
-rw-r--r--regressions/ck_rwcohort/ck_neutral.h8
-rw-r--r--regressions/ck_rwcohort/ck_rp.h8
-rw-r--r--regressions/ck_rwcohort/ck_wp.h8
-rw-r--r--regressions/ck_rwcohort/validate/Makefile25
-rw-r--r--regressions/ck_rwcohort/validate/ck_neutral.c2
-rw-r--r--regressions/ck_rwcohort/validate/ck_rp.c2
-rw-r--r--regressions/ck_rwcohort/validate/ck_wp.c2
-rw-r--r--regressions/ck_rwcohort/validate/validate.h209
-rw-r--r--regressions/ck_rwlock/benchmark/Makefile17
-rw-r--r--regressions/ck_rwlock/benchmark/latency.c134
-rw-r--r--regressions/ck_rwlock/benchmark/throughput.c254
-rw-r--r--regressions/ck_rwlock/validate/Makefile17
-rw-r--r--regressions/ck_rwlock/validate/validate.c447
-rw-r--r--regressions/ck_sequence/benchmark/Makefile18
-rw-r--r--regressions/ck_sequence/benchmark/ck_sequence.c91
-rw-r--r--regressions/ck_sequence/validate/Makefile17
-rw-r--r--regressions/ck_sequence/validate/ck_sequence.c171
-rw-r--r--regressions/ck_spinlock/benchmark/Makefile87
-rw-r--r--regressions/ck_spinlock/benchmark/ck_anderson.c8
-rw-r--r--regressions/ck_spinlock/benchmark/ck_cas.c8
-rw-r--r--regressions/ck_spinlock/benchmark/ck_clh.c7
-rw-r--r--regressions/ck_spinlock/benchmark/ck_dec.c7
-rw-r--r--regressions/ck_spinlock/benchmark/ck_fas.c7
-rw-r--r--regressions/ck_spinlock/benchmark/ck_hclh.c7
-rw-r--r--regressions/ck_spinlock/benchmark/ck_mcs.c7
-rw-r--r--regressions/ck_spinlock/benchmark/ck_spinlock.c7
-rw-r--r--regressions/ck_spinlock/benchmark/ck_ticket.c8
-rw-r--r--regressions/ck_spinlock/benchmark/ck_ticket_pb.c7
-rw-r--r--regressions/ck_spinlock/benchmark/latency.h76
-rw-r--r--regressions/ck_spinlock/benchmark/linux_spinlock.c7
-rw-r--r--regressions/ck_spinlock/benchmark/throughput.h218
-rw-r--r--regressions/ck_spinlock/ck_anderson.h11
-rw-r--r--regressions/ck_spinlock/ck_cas.h6
-rw-r--r--regressions/ck_spinlock/ck_clh.h9
-rw-r--r--regressions/ck_spinlock/ck_dec.h6
-rw-r--r--regressions/ck_spinlock/ck_fas.h6
-rw-r--r--regressions/ck_spinlock/ck_hclh.h16
-rw-r--r--regressions/ck_spinlock/ck_mcs.h7
-rw-r--r--regressions/ck_spinlock/ck_spinlock.h6
-rw-r--r--regressions/ck_spinlock/ck_ticket.h11
-rw-r--r--regressions/ck_spinlock/ck_ticket_pb.h6
-rw-r--r--regressions/ck_spinlock/linux_spinlock.h39
-rw-r--r--regressions/ck_spinlock/validate/Makefile57
-rw-r--r--regressions/ck_spinlock/validate/ck_anderson.c2
-rw-r--r--regressions/ck_spinlock/validate/ck_cas.c2
-rw-r--r--regressions/ck_spinlock/validate/ck_clh.c2
-rw-r--r--regressions/ck_spinlock/validate/ck_dec.c2
-rw-r--r--regressions/ck_spinlock/validate/ck_fas.c2
-rw-r--r--regressions/ck_spinlock/validate/ck_hclh.c2
-rw-r--r--regressions/ck_spinlock/validate/ck_mcs.c2
-rw-r--r--regressions/ck_spinlock/validate/ck_spinlock.c2
-rw-r--r--regressions/ck_spinlock/validate/ck_ticket.c2
-rw-r--r--regressions/ck_spinlock/validate/ck_ticket_pb.c2
-rw-r--r--regressions/ck_spinlock/validate/linux_spinlock.c14
-rw-r--r--regressions/ck_spinlock/validate/validate.h180
-rw-r--r--regressions/ck_stack/benchmark/Makefile14
-rw-r--r--regressions/ck_stack/benchmark/latency.c176
-rw-r--r--regressions/ck_stack/validate/Makefile56
-rw-r--r--regressions/ck_stack/validate/pair.c249
-rw-r--r--regressions/ck_stack/validate/pop.c269
-rw-r--r--regressions/ck_stack/validate/push.c248
-rw-r--r--regressions/ck_stack/validate/serial.c84
-rw-r--r--regressions/ck_swlock/benchmark/Makefile17
-rw-r--r--regressions/ck_swlock/benchmark/latency.c86
-rw-r--r--regressions/ck_swlock/benchmark/throughput.c183
-rw-r--r--regressions/ck_swlock/validate/Makefile17
-rw-r--r--regressions/ck_swlock/validate/validate.c455
-rw-r--r--regressions/ck_tflock/benchmark/Makefile17
-rw-r--r--regressions/ck_tflock/benchmark/latency.c73
-rw-r--r--regressions/ck_tflock/benchmark/throughput.c182
-rw-r--r--regressions/ck_tflock/validate/Makefile17
-rw-r--r--regressions/ck_tflock/validate/validate.c158
-rw-r--r--regressions/common.h466
-rw-r--r--src/Makefile.in64
-rw-r--r--src/ck_array.c240
-rw-r--r--src/ck_barrier_centralized.c59
-rw-r--r--src/ck_barrier_combining.c207
-rw-r--r--src/ck_barrier_dissemination.c130
-rw-r--r--src/ck_barrier_mcs.c141
-rw-r--r--src/ck_barrier_tournament.c184
-rw-r--r--src/ck_epoch.c544
-rw-r--r--src/ck_hp.c323
-rw-r--r--src/ck_hs.c941
-rw-r--r--src/ck_ht.c1036
-rw-r--r--src/ck_ht_hash.h269
-rw-r--r--src/ck_internal.h119
-rw-r--r--src/ck_rhs.c1480
-rwxr-xr-xtools/feature.sh5
459 files changed, 59452 insertions, 0 deletions
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 000000000000..73b0eeb10a5a
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,54 @@
+Copyright 2010-2014 Samy Al Bahra.
+Copyright 2011-2013 AppNexus, Inc.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
+Hazard Pointers (src/ck_hp.c) also includes this license:
+
+(c) Copyright 2008, IBM Corporation.
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+ck_pr_rtm leverages work from Andi Kleen:
+Copyright (c) 2012,2013 Intel Corporation
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that: (1) source code distributions
+retain the above copyright notice and this paragraph in its entirety, (2)
+distributions including binary code include the above copyright notice and
+this paragraph in its entirety in the documentation or other materials
+provided with the distribution
+
+THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
diff --git a/Makefile.in b/Makefile.in
new file mode 100644
index 000000000000..7e73f709e184
--- /dev/null
+++ b/Makefile.in
@@ -0,0 +1,103 @@
+.PHONY: all check clean dist distclean doc install install-headers regressions uninstall
+
+BUILD_DIR=@BUILD_DIR@
+SRC_DIR=@SRC_DIR@
+CFLAGS=@CFLAGS@
+VERSION=@VERSION@
+VERSION_MAJOR=@VERSION_MAJOR@
+PREFIX=@PREFIX@
+LIBRARY=@LIBRARY@
+HEADERS=@HEADERS@
+PKGCONFIG_DATA=@LIBRARY@/pkgconfig
+LDNAME=@LDNAME@
+LDNAME_VERSION=@LDNAME_VERSION@
+LDNAME_MAJOR=@LDNAME_MAJOR@
+
+all: doc
+ $(MAKE) -C src all || exit
+ @echo
+ @echo
+ @echo ---[ Concurrency Kit has built successfully. You may now \"make install\".
+
+doc:
+ $(MAKE) -C doc all || exit
+ @echo ---[ Manual pages are ready for installation.
+
+regressions:
+ $(MAKE) -C regressions all || exit
+ @echo ---[ Regressions have built successfully.
+
+check: regressions
+ @echo ---[ Executing unit tests...
+ $(MAKE) -C regressions check
+ @echo ---[ Unit tests have completed successfully.
+
+install-headers:
+ mkdir -p $(DESTDIR)/$(HEADERS) || exit
+ cp $(SRC_DIR)/include/*.h $(DESTDIR)/$(HEADERS) || exit
+ chmod 644 $(DESTDIR)/$(HEADERS)/ck_*.h || exit
+ mkdir -p $(DESTDIR)$(HEADERS)/gcc || exit
+ cp -r $(SRC_DIR)/include/gcc/* $(DESTDIR)/$(HEADERS)/gcc || exit
+ cp include/ck_md.h $(DESTDIR)/$(HEADERS)/ck_md.h || exit
+ chmod 755 $(DESTDIR)/$(HEADERS)/gcc
+ chmod 644 $(DESTDIR)/$(HEADERS)/gcc/ck_*.h $(DESTDIR)/$(HEADERS)/gcc/*/ck_*.h || exit
+ mkdir -p $(DESTDIR)$(HEADERS)/spinlock || exit
+ cp -r $(SRC_DIR)/include/spinlock/* $(DESTDIR)/$(HEADERS)/spinlock || exit
+ chmod 755 $(DESTDIR)/$(HEADERS)/spinlock
+ chmod 644 $(DESTDIR)/$(HEADERS)/spinlock/*.h || exit
+
+install-so:
+ mkdir -p $(DESTDIR)/$(LIBRARY)
+ cp src/libck.so $(DESTDIR)/$(LIBRARY)/$(LDNAME_VERSION)
+ ln -sf $(LDNAME_VERSION) $(DESTDIR)/$(LIBRARY)/$(LDNAME)
+ ln -sf $(LDNAME_VERSION) $(DESTDIR)/$(LIBRARY)/$(LDNAME_MAJOR)
+ chmod 744 $(DESTDIR)/$(LIBRARY)/$(LDNAME_VERSION) \
+ $(DESTDIR)/$(LIBRARY)/$(LDNAME) \
+ $(DESTDIR)/$(LIBRARY)/$(LDNAME_MAJOR)
+
+install-lib:
+ mkdir -p $(DESTDIR)/$(LIBRARY)
+ cp src/libck.a $(DESTDIR)/$(LIBRARY)/libck.a
+ chmod 644 $(DESTDIR)/$(LIBRARY)/libck.a
+
+install: all install-headers @INSTALL_LIBS@
+ $(MAKE) -C doc install
+ mkdir -p $(DESTDIR)/$(LIBRARY) || exit
+ mkdir -p $(DESTDIR)/$(PKGCONFIG_DATA) || exit
+ chmod 755 $(DESTDIR)/$(PKGCONFIG_DATA)
+ cp build/ck.pc $(DESTDIR)/$(PKGCONFIG_DATA)/ck.pc || exit
+ @echo
+ @echo
+ @echo ---[ Concurrency Kit has installed successfully.
+
+uninstall:
+ $(MAKE) -C doc uninstall
+ rm -f $(DESTDIR)/$(LIBRARY)/$(LDNAME_VERSION) \
+ $(DESTDIR)/$(LIBRARY)/$(LDNAME) \
+ $(DESTDIR)/$(LIBRARY)/$(LDNAME_MAJOR)
+ rm -f $(DESTDIR)/$(LIBRARY)/libck.so*
+ rm -f $(DESTDIR)/$(LIBRARY)/libck.a
+ rm -f $(DESTDIR)/$(HEADERS)/ck_*.h
+ rm -f $(DESTDIR)/$(HEADERS)/spinlock/*.h
+ rm -f $(DESTDIR)/$(HEADERS)/gcc/ck_*.h
+ rm -f $(DESTDIR)/$(HEADERS)/gcc/*/ck_*.h
+ rm -f $(DESTDIR)/$(PKGCONFIG_DATA)/ck.pc
+
+clean:
+ $(MAKE) -C doc clean
+ $(MAKE) -C src clean
+ $(MAKE) -C regressions clean
+ rm -f $(BUILD_DIR)/*~ $(BUILD_DIR)/*.o $(BUILD_DIR)/*.tar.gz
+
+dist:
+ git archive --remote=$(SRC_DIR) --format=tar --prefix=ck-$(VERSION)/ HEAD \
+ | gzip > $(BUILD_DIR)/ck-$(VERSION).tar.gz
+
+distclean: clean
+ rm -f $(BUILD_DIR)/include/ck_md.h
+ rm -f $(BUILD_DIR)/build/regressions.build
+ rm -f $(BUILD_DIR)/build/ck.build
+ rm -f $(BUILD_DIR)/build/ck.pc
+ rm -f $(BUILD_DIR)/Makefile
+ rm -f $(BUILD_DIR)/doc/Makefile
+
diff --git a/README b/README
new file mode 100644
index 000000000000..81fb5ac87ca8
--- /dev/null
+++ b/README
@@ -0,0 +1,21 @@
+ ____ _ ___ _
+ / ___|___ _ __ ___ _ _ _ __ _ __ ___ _ __ ___ _ _ | |/ (_) |_
+| | / _ \| '_ \ / __| | | | '__| '__/ _ \ '_ \ / __| | | | | ' /| | __|
+| |__| (_) | | | | (__| |_| | | | | | __/ | | | (__| |_| | | . \| | |_
+ \____\___/|_| |_|\___|\__,_|_| |_| \___|_| |_|\___|\__, | |_|\_\_|\__|
+ |___/
+
+Step 1.
+ ./configure
+ For additional options try ./configure --help
+
+Step 2.
+ In order to compile regressions (requires POSIX threads) use
+ "make regressions". In order to compile libck use "make all" or "make".
+
+Step 3.
+ In order to install use "make install"
+ To uninstall use "make uninstall".
+
+See http://concurrencykit.org/ for more information.
+
diff --git a/build/ck.build.aarch64 b/build/ck.build.aarch64
new file mode 100644
index 000000000000..8b137891791f
--- /dev/null
+++ b/build/ck.build.aarch64
@@ -0,0 +1 @@
+
diff --git a/build/ck.build.arm b/build/ck.build.arm
new file mode 100644
index 000000000000..3fa739cb6d08
--- /dev/null
+++ b/build/ck.build.arm
@@ -0,0 +1 @@
+CFLAGS+=-D__arm__
diff --git a/build/ck.build.in b/build/ck.build.in
new file mode 100644
index 000000000000..1d6bfe32bb4a
--- /dev/null
+++ b/build/ck.build.in
@@ -0,0 +1,10 @@
+CC=@CC@
+MAKE=make
+SRC_DIR=@SRC_DIR@
+BUILD_DIR=@BUILD_DIR@
+CFLAGS+=@CFLAGS@ -I$(SRC_DIR)/include -I$(BUILD_DIR)/include
+LDFLAGS+=@LDFLAGS@
+ALL_LIBS=@ALL_LIBS@
+LD=@LD@
+
+include $(BUILD_DIR)/build/ck.build.@PROFILE@
diff --git a/build/ck.build.ppc b/build/ck.build.ppc
new file mode 100644
index 000000000000..bd0c2fdf7e23
--- /dev/null
+++ b/build/ck.build.ppc
@@ -0,0 +1 @@
+CFLAGS+=-m32 -D__ppc__
diff --git a/build/ck.build.ppc64 b/build/ck.build.ppc64
new file mode 100644
index 000000000000..51003f4e4c83
--- /dev/null
+++ b/build/ck.build.ppc64
@@ -0,0 +1,2 @@
+CFLAGS+=-m64 -D__ppc64__
+LDFLAGS+=-m64
diff --git a/build/ck.build.sparcv9 b/build/ck.build.sparcv9
new file mode 100644
index 000000000000..d866841ba721
--- /dev/null
+++ b/build/ck.build.sparcv9
@@ -0,0 +1 @@
+CFLAGS+=-m64 -D__sparcv9__
diff --git a/build/ck.build.x86 b/build/ck.build.x86
new file mode 100644
index 000000000000..6e127839a11a
--- /dev/null
+++ b/build/ck.build.x86
@@ -0,0 +1,2 @@
+CFLAGS+=-m32 -D__x86__ -msse -msse2
+LDFLAGS+=-m32
diff --git a/build/ck.build.x86_64 b/build/ck.build.x86_64
new file mode 100644
index 000000000000..81b378a1bad0
--- /dev/null
+++ b/build/ck.build.x86_64
@@ -0,0 +1,2 @@
+CFLAGS+=-m64 -D__x86_64__
+LDFLAGS+=-m64
diff --git a/build/ck.pc.in b/build/ck.pc.in
new file mode 100644
index 000000000000..0f1e93b9e26b
--- /dev/null
+++ b/build/ck.pc.in
@@ -0,0 +1,10 @@
+prefix=@PREFIX@
+includedir=@HEADERS@
+libdir=@LIBRARY@
+
+Name: Concurrency Kit
+Description: Toolkit for well-specified design and implementation of concurrent systems
+URL: http://concurrencykit.org/
+Version: @VERSION@
+Libs: -L${libdir} -lck
+Cflags: -D__@PROFILE@__ -I${includedir} @PC_CFLAGS@
diff --git a/build/ck.spec.in b/build/ck.spec.in
new file mode 100644
index 000000000000..e486d53ff7d7
--- /dev/null
+++ b/build/ck.spec.in
@@ -0,0 +1,74 @@
+Name: ck
+Version: @VERSION@
+Release: 1%{?dist}
+Group: Development/Libraries
+Summary: Concurrency Kit
+License: Simplified BSD License
+URL: http://concurrencykit.org
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+Source: http://concurrencykit.org/releases/ck-%{version}.tar.gz
+
+%description
+Concurrency Kit provides a plethora of concurrency primitives, safe memory
+reclamation mechanisms and lock-less and lock-free data structures designed to
+aid in the design and implementation of high performance concurrent systems. It
+is designed to minimize dependencies on operating system-specific interfaces
+and most of the interface relies only on a strict subset of the standard
+library and more popular compiler extensions.
+
+%package devel
+Group: Development/Libraries
+Summary: Header files and libraries for CK development
+Requires: %{name} = %{version}-%{release}
+
+%description devel
+Concurrency Kit provides a plethora of concurrency primitives, safe memory
+reclamation mechanisms and lock-less and lock-free data structures designed to
+aid in the design and implementation of high performance concurrent systems. It
+is designed to minimize dependencies on operating system-specific interfaces
+and most of the interface relies only on a strict subset of the standard
+library and more popular compiler extensions.
+
+This package provides the libraries, include files, and other
+resources needed for developing Concurrency Kit applications.
+
+%prep
+%setup -q
+
+%build
+CFLAGS=$RPM_OPT_FLAGS ./configure \
+ --libdir=%{_libdir} \
+ --includedir=%{_includedir}/%{name} \
+ --mandir=%{_mandir} \
+ --prefix=%{_prefix}
+make %{?_smp_mflags}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make DESTDIR=$RPM_BUILD_ROOT install
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root,-)
+%{_libdir}/libck.so.@VERSION@
+%{_libdir}/libck.so.@VERSION_MAJOR@
+
+%files devel
+%defattr(-,root,root)
+%{_libdir}/libck.so
+%{_includedir}/%{name}/*.h
+%{_includedir}/%{name}/*/*.h
+%{_includedir}/%{name}/*/*/*.h
+%{_libdir}/libck.a
+%{_libdir}/pkgconfig/%{name}.pc
+%{_mandir}/man3/*.3.gz
+
+%post
+/sbin/ldconfig
+
+%postun
+/sbin/ldconfig
+
diff --git a/build/regressions.build.in b/build/regressions.build.in
new file mode 100644
index 000000000000..6d79a8b678a1
--- /dev/null
+++ b/build/regressions.build.in
@@ -0,0 +1,10 @@
+CC=@CC@
+MAKE=make
+CORES=@CORES@
+CFLAGS=@CFLAGS@ -I../../../include -DCORES=@CORES@
+LD=@LD@
+LDFLAGS=@LDFLAGS@
+PTHREAD_CFLAGS=@PTHREAD_CFLAGS@
+BUILD_DIR=@BUILD_DIR@
+
+include $(BUILD_DIR)/build/ck.build.@PROFILE@
diff --git a/configure b/configure
new file mode 100755
index 000000000000..a9c931ddcd53
--- /dev/null
+++ b/configure
@@ -0,0 +1,775 @@
+#!/bin/sh
+#
+# Copyright © 2009-2013 Samy Al Bahra.
+# Copyright © 2011 Devon H. O'Dell <devon.odell@gmail.com>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+REQUIRE_HEADER="stdbool.h stddef.h stdint.h string.h"
+
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+WANT_PIC=yes
+
+P_PWD=`pwd`
+MAINTAINER='sbahra@repnop.org'
+VERSION=${VERSION:-'0.5.2'}
+VERSION_MAJOR='0'
+BUILD="$PWD/build/ck.build"
+PREFIX=${PREFIX:-"/usr/local"}
+LDNAME="libck.so"
+LDNAME_VERSION="libck.so.$VERSION"
+LDNAME_MAJOR="libck.so.$VERSION_MAJOR"
+
+OPTION_CHECKING=1
+
+export CFLAGS
+export PREFIX
+LC_ALL=C
+export LC_ALL
+
+if test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+fi
+
+trap epilog 1 2 3 6
+
+epilog()
+{
+ rm -f .1.c .1
+}
+
+assert()
+{
+
+ if test "$#" -eq 2; then
+ fail=$2
+ print=true
+ elif test "$#" -eq 3; then
+ fail=$3
+ print=echo
+ else
+ echo "Usage: assert <test> <fail string> or assert <test> <success string> <fail string>" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ if test -z "$1"; then
+ echo "failed [$fail]"
+ exit $EXIT_FAILURE
+ else
+ ${print} "success [$1]"
+ fi
+}
+
+get_git_sha()
+{
+ # return a short SHA for the current HEAD
+ GIT_SHA=""
+ GIT_MSG="success"
+ gitcmd=`which git`
+ if test -n "$gitcmd"; then
+ GIT_SHA=`git rev-parse --short HEAD 2>/dev/null`
+ if ! test -n "$GIT_SHA"; then
+ GIT_MSG="not within a git repo"
+ fi
+ else
+ GIT_MSG="git not installed or executable"
+ fi
+}
+
+generate()
+{
+ sed -e "s#@PROFILE@#$PROFILE#g" \
+ -e "s#@VERSION@#$VERSION#g" \
+ -e "s#@VERSION_MAJOR@#$VERSION_MAJOR#g" \
+ -e "s#@CC@#$CC#g" \
+ -e "s#@CFLAGS@#$CFLAGS#g" \
+ -e "s#@HEADERS@#$HEADERS#g" \
+ -e "s#@LIBRARY@#$LIBRARY#g" \
+ -e "s#@PREFIX@#$PREFIX#g" \
+ -e "s#@CORES@#$CORES#g" \
+ -e "s#@ALL_LIBS@#$ALL_LIBS#g" \
+ -e "s#@INSTALL_LIBS@#$INSTALL_LIBS#g" \
+ -e "s#@LD@#$LD#g" \
+ -e "s#@LDFLAGS@#$LDFLAGS#g" \
+ -e "s#@PTHREAD_CFLAGS@#$PTHREAD_CFLAGS#g" \
+ -e "s#@MANDIR@#$MANDIR#g" \
+ -e "s#@GZIP@#$GZIP#g" \
+ -e "s#@GZIP_SUFFIX@#$GZIP_SUFFIX#g" \
+ -e "s#@POINTER_PACK_ENABLE@#$POINTER_PACK_ENABLE#g" \
+ -e "s#@RTM_ENABLE@#$RTM_ENABLE#g" \
+ -e "s#@VMA_BITS@#$VMA_BITS_R#g" \
+ -e "s#@VMA_BITS_VALUE@#$VMA_BITS_VALUE_R#g" \
+ -e "s#@MM@#$MM#g" \
+ -e "s#@BUILD_DIR@#$P_PWD#g" \
+ -e "s#@SRC_DIR@#$BUILD_DIR#g" \
+ -e "s#@LDNAME@#$LDNAME#g" \
+ -e "s#@LDNAME_MAJOR@#$LDNAME_MAJOR#g" \
+ -e "s#@LDNAME_VERSION@#$LDNAME_VERSION#g" \
+ -e "s#@PC_CFLAGS@#$PC_CFLAGS#g" \
+ -e "s#@GIT_SHA@#$GIT_SHA#g" \
+ $1 > $2
+}
+
+generate_stdout()
+{
+
+ echo
+ echo " VERSION = $VERSION"
+ echo " GIT_SHA = $GIT_SHA"
+ echo " BUILD_DIR = $P_PWD"
+ echo " SRC_DIR = $BUILD_DIR"
+ echo " SYSTEM = $SYSTEM"
+ echo " PROFILE = $PROFILE"
+ echo " CC = $CC"
+ echo " COMPILER = $COMPILER"
+ echo " CFLAGS = $CFLAGS"
+ echo " PTHREAD_CFLAGS = $PTHREAD_CFLAGS"
+ echo " LD = $LD"
+ echo " LDNAME = $LDNAME"
+ echo " LDNAME_VERSION = $LDNAME_VERSION"
+ echo " LDNAME_MAJOR = $LDNAME_MAJOR"
+ echo " LDFLAGS = $LDFLAGS"
+ echo " GZIP = $GZIP"
+ echo " CORES = $CORES"
+ echo " POINTER_PACK = $POINTER_PACK_ENABLE"
+ echo " VMA_BITS = $VMA_BITS"
+ echo " MEMORY_MODEL = $MM"
+ echo " RTM = $RTM_ENABLE"
+ echo
+ echo "Headers will be installed in $HEADERS"
+ echo "Libraries will be installed in $LIBRARY"
+ echo "Documentation will be installed in $MANDIR"
+}
+
+for option; do
+ case "$option" in
+ *=?*)
+ value=`expr -- "$option" : '[^=]*=\(.*\)'`
+ ;;
+ *=)
+ value=
+ ;;
+ *)
+ value=yes
+ ;;
+ esac
+
+ case "$option" in
+ --help)
+ echo "Usage: $0 [OPTIONS]"
+ echo
+ echo "The following options may be used for cross-building."
+ echo " --profile=N Use custom build profile (use in conjunction with \$CC)"
+ echo
+ echo "The following options may be used to modify installation behavior."
+ echo " --includedir=N Headers directory (default is ${PREFIX}/include)"
+ echo " --libdir=N Libraries directory (default is ${PREFIX}/lib)"
+ echo " --mandir=N Manual pages directory (default is ${PREFIX}/man)"
+ echo " --prefix=N Installs library files in N (default is $PREFIX)"
+ echo
+ echo "The following options will affect generated code."
+ echo " --enable-pointer-packing Assumes address encoding is subset of pointer range"
+ echo " --enable-rtm Enable restricted transactional memory (power, x86_64)"
+ echo " --memory-model=N Specify memory model (currently tso, pso or rmo)"
+ echo " --vma-bits=N Specify valid number of VMA bits"
+ echo " --platform=N Force the platform type, instead of relying on autodetection"
+ echo " --use-cc-builtins Use the compiler atomic bultin functions, instead of the CK implementation"
+ echo
+ echo "The following options affect regression testing."
+ echo " --cores=N Specify number of cores available on target machine"
+ echo
+ echo "The following environment variables may be used:"
+ echo " CC C compiler command"
+ echo " CFLAGS C compiler flags"
+ echo " LDFLAGS Linker flags"
+ echo " GZIP GZIP compression tool"
+ echo
+ echo "Report bugs to ${MAINTAINER}."
+ exit $EXIT_SUCCESS
+ ;;
+ --memory-model=*)
+ case "$value" in
+ "tso")
+ MM="CK_MD_TSO"
+ ;;
+ "rmo")
+ MM="CK_MD_RMO"
+ ;;
+ "pso")
+ MM="CK_MD_PSO"
+ ;;
+ *)
+ echo "./configure [--help]"
+ exit $EXIT_FAILURE
+ ;;
+ esac
+ ;;
+ --vma-bits=*)
+ VMA_BITS=$value
+ ;;
+ --enable-pointer-packing)
+ POINTER_PACK_ENABLE="CK_MD_POINTER_PACK_ENABLE"
+ ;;
+ --enable-rtm)
+ RTM_ENABLE_SET="CK_MD_RTM_ENABLE"
+ ;;
+ --cores=*)
+ CORES=$value
+ ;;
+ --profile=*)
+ PROFILE=$value
+ ;;
+ --prefix=*)
+ PREFIX=$value
+ ;;
+ --includedir=*)
+ HEADERS=$value
+ ;;
+ --libdir=*)
+ LIBRARY=$value
+ ;;
+ --mandir=*)
+ MANDIR=$value
+ ;;
+ --with-pic)
+ WANT_PIC=yes
+ ;;
+ --without-pic)
+ WANT_PIC=no
+ ;;
+ --disable-option-checking)
+ OPTION_CHECKING=0
+ ;;
+ --use-cc-builtins)
+ USE_CC_BUILTINS=1
+ ;;
+ --platform=*)
+ PLATFORM=$value
+ ;;
+ --build=*|--host=*|--target=*|--exec-prefix=*|--bindir=*|--sbindir=*|\
+ --sysconfdir=*|--datadir=*|--libexecdir=*|--localstatedir=*|\
+ --enable-static|\
+ --sharedstatedir=*|--infodir=*|--enable-shared|--disable-shared|\
+ --cache-file=*|--srcdir=*)
+ # ignore for compat with regular configure
+ ;;
+ --*)
+ if test "$OPTION_CHECKING" -eq 1; then
+ echo "$0 [--help]"
+ echo "Unknown option $option"
+ exit $EXIT_FAILURE
+ fi
+ ;;
+ *=*)
+ NAME=`expr -- "$option" : '\([^=]*\)='`
+ eval "$NAME='$value'"
+ export $NAME
+ ;;
+ *)
+ echo "$0 [--help]"
+ echo "Unknown option $option"
+ exit $EXIT_FAILURE
+ ;;
+ esac
+done
+
+HEADERS=${HEADERS:-"${PREFIX}/include"}
+LIBRARY=${LIBRARY:-"${PREFIX}/lib"}
+MANDIR=${MANDIR:-"${PREFIX}/share/man"}
+GZIP=${GZIP:-"gzip -c"}
+POINTER_PACK_ENABLE=${POINTER_PACK_ENABLE:-"CK_MD_POINTER_PACK_DISABLE"}
+RTM_ENABLE=${RTM_ENABLE_SET:-"CK_MD_RTM_DISABLE"}
+VMA_BITS=${VMA_BITS:-"unknown"}
+
+DCORES=2
+printf "Detecting operating system......."
+SYSTEM=`uname -s 2> /dev/null`
+case "$SYSTEM" in
+ "SunOS")
+ SYSTEM=solaris
+ ;;
+ "Linux"|"uClinux")
+ DCORES=`egrep '(^CPU[0-9]+|^processor.*:.*)' /proc/cpuinfo|wc -l`
+ SYSTEM=linux
+ ;;
+ "FreeBSD"|"GNU/kFreeBSD")
+ DCORES=`sysctl -n hw.ncpu`
+ SYSTEM=freebsd
+ ;;
+ "NetBSD")
+ DCORES=`sysctl -n hw.ncpu`
+ SYSTEM=netbsd
+ ;;
+ "OpenBSD")
+ DCORES=`sysctl -n hw.ncpu`
+ SYSTEM=openbsd
+ ;;
+ "DragonFly")
+ DCORES=`sysctl -n hw.ncpu`
+ SYSTEM=dragonflybsd
+ ;;
+ "Darwin")
+ DCORES=`sysctl -n hw.ncpu`
+ SYSTEM=darwin
+ ;;
+ MINGW32*)
+ SYSTEM=mingw32
+ LDFLAGS="-mthreads $LDFLAGS"
+ ;;
+ CYGWIN_NT*)
+ SYSTEM=cygwin
+ LDFLAGS="-mthreads $LDFLAGS"
+ ;;
+ *)
+ SYSTEM=
+ ;;
+esac
+
+assert "$SYSTEM" "$SYSTEM" "unsupported"
+
+CORES=${CORES:-${DCORES}}
+printf "Detecting machine architecture..."
+if test "x$PLATFORM" = "x"; then
+ PLATFORM=`uname -m 2> /dev/null`
+fi
+
+case $PLATFORM in
+ "macppc"|"Power Macintosh"|"powerpc")
+ RTM_ENABLE="CK_MD_RTM_DISABLE"
+ MM="${MM:-"CK_MD_RMO"}"
+ PLATFORM=ppc
+ ENVIRONMENT=32
+ LDFLAGS="-m32 $LDFLAGS"
+ ;;
+ "sun4u"|"sun4v"|"sparc64")
+ RTM_ENABLE="CK_MD_RTM_DISABLE"
+ MM="${MM:-"CK_MD_TSO"}"
+ PLATFORM=sparcv9
+ ENVIRONMENT=64
+ LDFLAGS="-m64 $LDFLAGS"
+ ;;
+ i386|i486|i586|i686|i586_i686|pentium*|athlon*|k5|k6|k6_2|k6_3)
+ MM="${MM:-"CK_MD_TSO"}"
+ case $SYSTEM in
+ darwin)
+ ENVIRONMENT=64
+ PLATFORM=x86_64
+ ;;
+ freebsd)
+ PLATFORM=x86
+ ENVIRONMENT=32
+
+ # FreeBSD doesn't give us a nice way to determine the CPU
+ # class of the running system, reporting any 32-bit x86
+ # architecture as i386. 486 is its minimum supported CPU
+ # class and cmpxchg8b was implemented first in i586.
+ dmesg | grep -q "486-class"
+ if test "$?" -eq 0; then
+ assert "" "" "Must have an i586 class or higher CPU"
+ fi
+
+ # FreeBSD still generates code for 486-class CPUs as its
+ # default 32-bit target, but we need 586 at the least.
+ echo "$CFLAGS" | grep -q 'march='
+ if test "$?" -ne 0; then
+ # Needed for cmpxchg8b
+ CFLAGS="$CFLAGS -march=i586"
+ fi
+ ;;
+ linux)
+ case $PLATFORM in
+ i386|i486)
+ assert "" "" "Must have an i586 class or higher CPU"
+ ;;
+ esac
+
+ PLATFORM=x86
+ ENVIRONMENT=32
+ ;;
+
+ *)
+ PLATFORM=x86
+ ENVIRONMENT=32
+ assert "$PLATFORM $ENVIRONMENT" "$PLATFORM $ENVIRONMENT" "unsupported"
+ ;;
+ esac
+ ;;
+ "amd64"|"x86_64")
+ PLATFORM=x86_64
+ ENVIRONMENT=64
+ LDFLAGS="-m64 $LDFLAGS"
+ MM="${MM:-"CK_MD_TSO"}"
+ ;;
+ "i86pc")
+ RTM_ENABLE="CK_MD_RTM_DISABLE"
+ MM="${MM:-"CK_MD_TSO"}"
+ if test -z "$ISA"; then ISA=`isainfo -n 2> /dev/null || echo i386` ; fi
+ case "$ISA" in
+ "amd64")
+ RTM_ENABLE=${RTM_ENABLE_SET:-"CK_MD_RTM_DISABLE"}
+ PLATFORM=x86_64
+ ENVIRONMENT=64
+ ;;
+ *)
+ PLATFORM=x86
+ ENVIRONMENT=32
+ assert "$PLATFORM $ENVIRONMENT" "$PLATFORM $ENVIRONMENT" "unsupported"
+ ;;
+ esac
+ ;;
+ "ppc64"|"ppc64le")
+ RTM_ENABLE="CK_MD_RTM_DISABLE"
+ MM="${MM:-"CK_MD_RMO"}"
+ PLATFORM=ppc64
+ ENVIRONMENT=64
+ ;;
+ arm|armv6l|armv7l)
+ if test "$PLATFORM" = "armv6l"; then
+ CFLAGS="$CFLAGS -march=armv6k";
+ elif test "$PLATFORM" = "armv7l"; then
+ CFLAGS="$CFLAGS -march=armv7-a";
+ fi
+ RTM_ENABLE="CK_MD_RTM_DISABLE"
+ MM="${MM:-"CK_MD_RMO"}"
+ PLATFORM=arm
+ ENVIRONMENT=32
+ ;;
+ "arm64"|"aarch64")
+ RTM_ENABLE="CK_MD_RTM_DISABLE"
+ MM="${MM:-"CK_MD_RMO"}"
+ PLATFORM=aarch64
+ ENVIRONMENT=64
+ ;;
+ *)
+ RTM_ENABLE="CK_MD_RTM_DISABLE"
+ PLATFORM=
+ MM="${MM:-"CK_MD_RMO"}"
+ ;;
+esac
+
+assert "$PLATFORM" "$PLATFORM" "unsupported"
+
+if test "$VMA" = "unknown"; then
+ VMA_BITS_R="CK_MD_VMA_BITS_UNKNOWN"
+ VMA_BITS_VALUE_R=""
+ POINTER_PACK_ENABLE="CK_MD_POINTER_PACK_DISABLE"
+else
+ VMA_BITS_R="CK_MD_VMA_BITS"
+ VMA_BITS_VALUE_R="${VMA_BITS}ULL"
+fi
+
+if test "$USE_CC_BUILTINS"; then
+ CFLAGS="$CFLAGS -DCK_CC_BUILTINS"
+ PC_CFLAGS="-DCK_CC_BULITINS"
+fi
+
+# `which` on Solaris sucks
+pathsearch()
+{
+ what=$1
+ oldFS="$IFS"
+ IFS=":"
+ for d in $PATH ; do
+ if test -x "$d/$what" ; then
+ echo "$d/$what";
+ IFS="$oldFS"
+ return
+ fi
+ done
+ IFS="$oldFS"
+}
+
+printf "Finding dirname command.........."
+DIRNAME=`pathsearch "${DIRNAME:-dirname}"`
+if test -z "$DIRNAME" -o ! -x "$DIRNAME"; then
+ DIRNAME=`pathsearch "${DIRNAME:-dirname}"`
+ DIRNAME="$DIRNAME"
+else
+ echo "success [$DIRNAME]"
+fi
+
+if test -z "$DIRNAME"; then
+ echo "not found (out of source build unsupported)"
+else
+ printf "Determining build directory......"
+
+ BUILD_DIR=`$DIRNAME $0`
+ cd `$DIRNAME $0`
+ BUILD_DIR=`pwd`
+
+ echo "success [$BUILD_DIR]"
+fi
+
+printf "Finding gzip tool................"
+GZIP=`pathsearch "${GZIP:-gzip}"`
+if test -z "$GZIP" -o ! -x "$GZIP"; then
+ GZIP=`pathsearch "${GZIP:-gzip}"`
+ GZIP="$GZIP"
+fi
+
+if test -z "$GZIP"; then
+ echo "not found"
+ GZIP=cat
+ GZIP_SUFFIX=""
+else
+ echo "success [$GZIP]"
+ GZIP="$GZIP -c"
+ GZIP_SUFFIX=".gz"
+fi
+
+printf "Finding suitable compiler........"
+CC=`pathsearch "${CC:-cc}"`
+if test -z "$CC" -o ! -x "$CC"; then
+ CC=`pathsearch "${CC:-gcc}"`
+fi
+assert "$CC" "not found"
+
+cat << EOF > .1.c
+#include <stdio.h>
+int main(void) {
+#if defined(_WIN32)
+#if defined(__MINGW64__)
+ puts("mingw64");
+ return (0);
+#elif defined(__MINGW32__) && (__MINGW32_MAJOR_VERSION >= 3)
+ puts("mingw32");
+ return (0);
+#else
+ return (1);
+#endif /* __MINGW32__ && __MINGW32_MAJOR_VERSION >= 3 */
+#elif defined(__clang__) && (__clang_major__ >= 3)
+ puts("clang");
+ return (0);
+#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5110)
+ puts("suncc");
+ return (0);
+#elif defined(__GNUC__) && (__GNUC__ >= 4)
+ puts("gcc");
+ return (0);
+#else
+ return (1);
+#endif
+}
+EOF
+
+$CC -o .1 .1.c
+COMPILER=`./.1`
+r=$?
+rm -f .1.c .1
+
+if test "$r" -ne 0; then
+ assert "" "update compiler"
+else
+ echo "success [$CC]"
+fi
+
+if test "$COMPILER" = "suncc"; then
+ LD=/bin/ld
+ LDFLAGS="-G -z text -h libck.so.$VERSION_MAJOR $LDFLAGS"
+ CFLAGS="-xO5 $CFLAGS"
+ PTHREAD_CFLAGS="-mt -lpthread"
+elif test "$COMPILER" = "gcc" || test "$COMPILER" = "clang" || test "$COMPILER" = "mingw32" || test "$COMPILER" = "mingw64"; then
+ LD=$CC
+ SONAME="$LDNAME_MAJOR"
+ if test "$SYSTEM" = "darwin"; then
+ CC_WL_OPT="-install_name"
+ LDNAME="libck.dylib"
+ LDNAME_VERSION="libck.$VERSION.dylib"
+ LDNAME_MAJOR="libck.$VERSION_MAJOR.dylib"
+ SONAME="$LIBRARY/$LDNAME_MAJOR"
+ else
+ CC_WL_OPT="-soname"
+ fi
+
+ LDFLAGS="-Wl,$CC_WL_OPT,$SONAME $LDFLAGS"
+ if test "$WANT_PIC" = "yes"; then
+ LDFLAGS="$LDFLAGS -shared -fPIC"
+ CFLAGS="$CFLAGS -fPIC"
+ ALL_LIBS="libck.so libck.a"
+ INSTALL_LIBS="install-so install-lib"
+ else
+ LDFLAGS="$LDFLAGS -fno-PIC"
+ CFLAGS="$CFLAGS -fno-PIC"
+ ALL_LIBS="libck.a"
+ INSTALL_LIBS="install-lib"
+ fi
+
+ CFLAGS="-D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE -std=gnu99 -pedantic -Wall -W -Wundef -Wendif-labels -Wshadow -Wpointer-arith -Wcast-align -Wcast-qual -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wdisabled-optimization -fstrict-aliasing -O2 -pipe -Wno-parentheses $CFLAGS"
+ PTHREAD_CFLAGS="-pthread"
+ if test "$COMPILER" = "mingw64"; then
+ ENVIRONMENT=64
+ PLATFORM=x86_64
+ fi
+else
+ assert "" "unknown compiler"
+fi
+
+printf "Detecting VMA bits..............."
+VMA="unknown"
+if test "$VMA_BITS" = "unknown"; then
+ if test "$PLATFORM" = "x86" || test $PLATFORM = "x86_64"; then
+ case $SYSTEM in
+ darwin)
+ VMA=`sysctl -n machdep.cpu.address_bits.virtual`
+ ;;
+ linux)
+ VMA=`awk '/address sizes/ {print $7;exit}' /proc/cpuinfo`
+ ;;
+ *)
+ if test "$PLATFORM" = "x86"; then
+ VMA="32"
+ else
+ cat << EOF > .1.c
+ #include <stdio.h>
+
+ int main(int argc, char *argv[])
+ {
+ unsigned long ret = 0x80000000;
+
+ __asm __volatile("cpuid\n"
+ : "+a" (ret));
+ if (ret >= 0x80000008) {
+ ret = 0x80000008;
+ __asm __volatile("cpuid\n"
+ : "+a" (ret));
+ printf("%lu\n", (ret >> 8) & 0xff);
+ } else {
+ return (1);
+ }
+ return (0);
+ }
+EOF
+
+ $CC -o .1 .1.c 2>/dev/null
+ VMA=`./.1 2>/dev/null`
+ if test $? -ne 0; then
+ VMA="unknown"
+ fi
+ rm -f .1.c .1
+ fi
+ esac
+ fi
+
+ VMA_BITS=$VMA
+else
+ VMA=$VMA_BITS
+fi
+
+if test "$VMA" = "unknown"; then
+ echo "unknown"
+ VMA_BITS_R="CK_MD_VMA_BITS_UNKNOWN"
+ VMA_BITS_VALUE_R=""
+ POINTER_PACK_ENABLE="CK_MD_POINTER_PACK_DISABLE"
+else
+ echo "success [$VMA]"
+ VMA_BITS_R="CK_MD_VMA_BITS"
+ VMA_BITS_VALUE_R="${VMA_BITS}ULL"
+fi
+
+for i in $REQUIRE_HEADER; do
+ printf "Checking header file usability..."
+
+ cat << EOF > .1.c
+#include <$i>
+int main(void){return(0);}
+EOF
+ $CC -o .1 .1.c 2> /dev/null
+ hf_s=$?
+
+ rm -f .1 .1.c
+ if test $hf_s -eq 0; then
+ echo "success [$i]"
+ else
+ echo "failed [$i]"
+ exit $EXIT_FAILURE
+ fi
+done
+
+printf "Detecting git SHA................"
+get_git_sha
+echo "$GIT_MSG [$GIT_SHA]"
+
+if test "$PROFILE"; then
+ printf "Using user-specified profile....."
+
+ if test -z "$CC"; then
+ echo "failed [specify compiler]"
+ exit $EXIT_FAILURE
+ fi
+
+ if test ! -f build/ck.build.$PROFILE; then
+ echo "failed [$PROFILE]"
+ exit $EXIT_FAILURE
+ fi
+
+ echo "success [$PROFILE]"
+ printf "Generating header files.........."
+ generate include/ck_md.h.in include/ck_md.h
+ echo "success"
+ printf "Generating build files..........."
+ generate src/Makefile.in src/Makefile
+ generate doc/Makefile.in doc/Makefile
+ generate build/ck.build.in build/ck.build
+ generate build/regressions.build.in build/regressions.build
+ generate build/ck.pc.in build/ck.pc
+ generate build/ck.spec.in build/ck.spec
+ generate Makefile.in Makefile
+ echo "success"
+ generate_stdout
+ exit $EXIT_SUCCESS
+fi
+
+# Platform will be used as a macro.
+PROFILE="${PROFILE:-$PLATFORM}"
+PLATFORM="__${PLATFORM}__"
+
+printf "Generating header files.........."
+generate include/ck_md.h.in include/ck_md.h
+echo "success"
+
+printf "Generating build files..........."
+
+mkdir -p $P_PWD/doc
+mkdir -p $P_PWD/build
+mkdir -p $P_PWD/include
+mkdir -p $P_PWD/src
+
+if test "$P_PWD" '!=' "$BUILD_DIR"; then
+ mkdir -p $P_PWD/regressions
+ cp $BUILD_DIR/regressions/Makefile.unsupported $P_PWD/regressions/Makefile &> /dev/null
+ cp $BUILD_DIR/build/ck.build.$PROFILE $P_PWD/build/ck.build.$PROFILE &> /dev/null
+ cp $BUILD_DIR/include/ck_md.h $P_PWD/include/ck_md.h &> /dev/null
+fi
+
+generate src/Makefile.in $P_PWD/src/Makefile
+generate doc/Makefile.in $P_PWD/doc/Makefile
+generate build/ck.build.in $P_PWD/build/ck.build
+generate build/regressions.build.in $P_PWD/build/regressions.build
+generate build/ck.pc.in $P_PWD/build/ck.pc
+generate build/ck.spec.in $P_PWD/build/ck.spec
+generate Makefile.in $P_PWD/Makefile
+touch src/*.c
+echo "success"
+generate_stdout
diff --git a/doc/CK_ARRAY_FOREACH b/doc/CK_ARRAY_FOREACH
new file mode 100644
index 000000000000..d85b767c34ea
--- /dev/null
+++ b/doc/CK_ARRAY_FOREACH
@@ -0,0 +1,79 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd October 18, 2013
+.Dt CK_ARRAY_FOREACH 3
+.Sh NAME
+.Nm CK_ARRAY_FOREACH
+.Nd iterate through an array
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_array.h
+.Ft bool
+.Fn CK_ARRAY_FOREACH "ck_array_t *array" "ck_array_iterator_t *iterator" "void **b"
+.Sh DESCRIPTION
+The
+.Fn CK_ARRAY_FOREACH 3
+macro iterates through the array pointed to by
+.Fa array .
+A pointer to an iterator object must be specified by
+.Fa iterator
+and
+.Fa b
+must point to a void pointer.
+.Sh EXAMPLE
+.Bd -literal -offset indent
+#include <ck_array.h>
+
+/* Assume this was already previously initialized. */
+ck_array_t array;
+
+void
+example(void)
+{
+ ck_array_iterator_t iterator;
+ void *pointer;
+
+ CK_ARRAY_FOREACH(&array, &iterator, &pointer) {
+ do_something(pointer);
+ }
+}
+.Ed
+.Sh RETURN VALUES
+This macro has no return value.
+.Sh SEE ALSO
+.Xr ck_array_init 3 ,
+.Xr ck_array_commit 3 ,
+.Xr ck_array_put 3 ,
+.Xr ck_array_put_unique 3 ,
+.Xr ck_array_remove 3 ,
+.Xr ck_array_deinit 3
+.Xr ck_array_length 3 ,
+.Xr ck_array_buffer 3 ,
+.Xr ck_array_initialized 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/CK_COHORT_INIT b/doc/CK_COHORT_INIT
new file mode 100644
index 000000000000..94454d9f07e8
--- /dev/null
+++ b/doc/CK_COHORT_INIT
@@ -0,0 +1,66 @@
+.\"
+.\" Copyright 2013 Brendon Scheinman.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd February 24, 2013.
+.Dt CK_COHORT_INIT 3
+.Sh NAME
+.Nm CK_COHORT_INIT
+.Nd initialize instance of a cohort type
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_cohort.h
+.Fn CK_COHORT_INIT "COHORT_NAME cohort_name" "COHORT *cohort" "void *global_lock" \
+"void *local_lock" "unsigned int pass_limit"
+.Sh DESCRIPTION
+Until a cohort instance is initialized using the CK_COHORT_INIT macro, any operations
+involving it will have undefined behavior. After this macro has been called, the cohort
+pointed to by the
+.Fa cohort
+argument will use the lock pointed to by
+.Fa global_lock
+as its global lock and the lock pointed to by
+.Fa local_lock
+as its local lock.
+.Pp
+The cohort will relinquish its global lock after
+.Fa pass_limit
+consecutive acquisitions of its local lock, even if there are other threads waiting.
+If you are unsure of a value to use for the
+.Fa pass_limit
+argument, you should use CK_COHORT_DEFAULT_LOCAL_PASS_LIMIT.
+.Sh SEE ALSO
+.Xr ck_cohort 3 ,
+.Xr CK_COHORT_PROTOTYPE 3 ,
+.Xr CK_COHORT_TRYLOCK_PROTOTYPE 3 ,
+.Xr CK_COHORT_INSTANCE 3 ,
+.Xr CK_COHORT_INITIALIZER 3 ,
+.Xr CK_COHORT_LOCK 3 ,
+.Xr CK_COHORT_UNLOCK 3 ,
+.Xr CK_COHORT_LOCKED 3 ,
+.Xr CK_COHORT_TRYLOCK 3 ,
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/CK_COHORT_INSTANCE b/doc/CK_COHORT_INSTANCE
new file mode 100644
index 000000000000..cec16171a869
--- /dev/null
+++ b/doc/CK_COHORT_INSTANCE
@@ -0,0 +1,59 @@
+.\"
+.\" Copyright 2013 Brendon Scheinman.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd February 24, 2013.
+.Dt CK_COHORT_INSTANCE 3
+.Sh NAME
+.Nm CK_COHORT_INSTANCE
+.Nd declare an instance of a cohort type
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_cohort.h
+.Fn CK_COHORT_INSTANCE "COHORT_NAME cohort_name"
+.Sh DESCRIPTION
+The user must use this macro to declare instances of cohort types that they have
+defined. For instance, if they have used the CK_COHORT_PROTOTYPE macro to define
+a cohort type with name foo, they would create an instance of this type as follows:
+.br
+CK_COHORT_INSTANCE(foo) cohort;
+.Pp
+This macro should also be used when allocating memory for cohorts. For instance,
+to allocate a block of 4 cohorts:
+.br
+CK_COHORT_INSTANCE(foo) *cohorts = malloc(4 * sizeof(CK_COHORT_INSTANCE(foo)));
+.Sh SEE ALSO
+.Xr ck_cohort 3 ,
+.Xr CK_COHORT_PROTOTYPE 3 ,
+.Xr CK_COHORT_TRYLOCK_PROTOTYPE 3 ,
+.Xr CK_COHORT_INSTANCE 3 ,
+.Xr CK_COHORT_INITIALIZER 3 ,
+.Xr CK_COHORT_LOCK 3 ,
+.Xr CK_COHORT_UNLOCK 3 ,
+.Xr CK_COHORT_LOCKED 3 ,
+.Xr CK_COHORT_TRYLOCK 3 ,
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/CK_COHORT_LOCK b/doc/CK_COHORT_LOCK
new file mode 100644
index 000000000000..22475f81b2be
--- /dev/null
+++ b/doc/CK_COHORT_LOCK
@@ -0,0 +1,61 @@
+.\"
+.\" Copyright 2013 Brendon Scheinman.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd February 24, 2013.
+.Dt CK_COHORT_LOCK 3
+.Sh NAME
+.Nm CK_COHORT_LOCK
+.Nd acquire cohort lock
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_cohort.h
+.Fn CK_COHORT_LOCK "COHORT_NAME cohort_name" "COHORT *cohort" "void *global_context" \
+"void *local_context"
+.Sh DESCRIPTION
+This call attempts to acquire both the local and global (if necessary) locks from
+.Fa cohort .
+The call will block until both locks have been acquired.
+.Fa global_context
+will be passed as the second argument to the function that was provided as the
+.Fa global_lock_method
+argument to CK_COHORT_PROTOTYPE if that method is called, and
+.Fa local_context
+will be passed to the function specified by
+.Fa local_lock_method
+.
+.Sh SEE ALSO
+.Xr ck_cohort 3 ,
+.Xr CK_COHORT_PROTOTYPE 3 ,
+.Xr CK_COHORT_TRYLOCK_PROTOTYPE 3 ,
+.Xr CK_COHORT_INSTANCE 3 ,
+.Xr CK_COHORT_INITIALIZER 3 ,
+.Xr CK_COHORT_INIT 3 ,
+.Xr CK_COHORT_UNLOCK 3 ,
+.Xr CK_COHORT_LOCKED 3 ,
+.Xr CK_COHORT_TRYLOCK 3 ,
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/CK_COHORT_PROTOTYPE b/doc/CK_COHORT_PROTOTYPE
new file mode 100644
index 000000000000..7a7b1a717f6e
--- /dev/null
+++ b/doc/CK_COHORT_PROTOTYPE
@@ -0,0 +1,76 @@
+.\"
+.\" Copyright 2013 Brendon Scheinman.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd February 24, 2013.
+.Dt CK_COHORT_PROTOTYPE 3
+.Sh NAME
+.Nm CK_COHORT_PROTOTYPE
+.Nd define cohort type with specified lock types
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_cohort.h
+.Fn CK_COHORT_PROTOTYPE "COHORT_NAME cohort_name" "TYPE global_lock_method" \
+"LOCK_FXN global_unlock_method" "LOCK_FXN local_lock_method" "LOCK_FXN local_unlock_method"
+.Sh DESCRIPTION
+The ck_cohort.h header file does not define any cohort types. Instead, the user must use
+the CK_COHORT_PROTOTYPE or
+.Xr CK_COHORT_TRYLOCK_PROTOTYPE 3
+macros to define any types they want to use. They must use CK_COHORT_TRYLOCK_PROTOTYPE
+if they want their cohort type to support trylock operations.
+The CK_COHORT_PROTOTYPE macro takes the following arguments:
+.Pp
+.Fa cohort_name
+: An identifier used for this cohort type. This will have to be passed to each
+of the other CK_COHORT macros.
+.br
+.Fa global_lock_method
+: The method that should be called to acquire the global lock
+.br
+.Fa global_unlock_method
+: The method that should be called to relinquish the global lock
+.br
+.Fa local_lock_method
+: The method that should be called to acquire the local lock
+.br
+.Fa local_unlock_method
+: The method that should be called to relinquish the local lock
+.Pp
+Instances of the defined cohort type can be declared as:
+.br
+ CK_COHORT_INSTANCE(cohort_name) cohort;
+.Sh SEE ALSO
+.Xr ck_cohort 3 ,
+.Xr CK_COHORT_TRYLOCK_PROTOTYPE 3 ,
+.Xr CK_COHORT_INSTANCE 3 ,
+.Xr CK_COHORT_INITIALIZER 3 ,
+.Xr CK_COHORT_INIT 3 ,
+.Xr CK_COHORT_LOCK 3 ,
+.Xr CK_COHORT_UNLOCK 3 ,
+.Xr CK_COHORT_LOCKED 3 ,
+.Xr CK_COHORT_TRYLOCK 3 ,
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/CK_COHORT_TRYLOCK b/doc/CK_COHORT_TRYLOCK
new file mode 100644
index 000000000000..22bb4b52f856
--- /dev/null
+++ b/doc/CK_COHORT_TRYLOCK
@@ -0,0 +1,69 @@
+.\"
+.\" Copyright 2013 Brendon Scheinman.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd March 9, 2013.
+.Dt CK_COHORT_TRYLOCK 3
+.Sh NAME
+.Nm CK_COHORT_TRYLOCK
+.Nd try to acquire cohort lock
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_cohort.h
+.Fn CK_COHORT_TRYLOCK "COHORT_NAME cohort_name" "COHORT *cohort" "void *global_trylock_context" \
+"void *local_trylock_context" "void *lock_unlock_context"
+.Sh DESCRIPTION
+This call attempts to acquire both the local and global (if necessary) locks from
+.Fa cohort .
+It can only be used with cohort types that were defined using the
+.Xr CK_COHORT_TRYLOCK_PROTOTYPE 3
+macro. The call will not block and will return a bool that will evaluate to true iff
+the cohort was successfully acquired.
+.Fa global_trylock_context
+will be passed as the second argument to the function that was provided as the
+.Fa global_trylock_method
+argument to CK_COHORT_TRYLOCK_PROTOTYPE if that method is called, and
+.Fa local_trylock_context
+will be passed to the function specified by
+.Fa local_trylock_method .
+If the global lock acquisition fails, then the cohort will immediately release its
+local lock as well, and
+.Fa local_unlock_context
+will be passed to the function specified by
+.Fa local_unlock_method
+when this call is made.
+.Sh SEE ALSO
+.Xr ck_cohort 3 ,
+.Xr CK_COHORT_PROTOTYPE 3 ,
+.Xr CK_COHORT_TRYLOCK_PROTOTYPE 3 ,
+.Xr CK_COHORT_INSTANCE 3 ,
+.Xr CK_COHORT_INITIALIZER 3 ,
+.Xr CK_COHORT_INIT 3 ,
+.Xr CK_COHORT_LOCK 3 ,
+.Xr CK_COHORT_UNLOCK 3 ,
+.Xr CK_COHORT_LOCKED 3 ,
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/CK_COHORT_TRYLOCK_PROTOTYPE b/doc/CK_COHORT_TRYLOCK_PROTOTYPE
new file mode 100644
index 000000000000..dd97ad47b94e
--- /dev/null
+++ b/doc/CK_COHORT_TRYLOCK_PROTOTYPE
@@ -0,0 +1,90 @@
+.\"
+.\" Copyright 2013 Brendon Scheinman.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd March 9, 2013.
+.Dt CK_COHORT_TRYLOCK_PROTOTYPE 3
+.Sh NAME
+.Nm CK_COHORT_TRYLOCK_PROTOTYPE
+.Nd define cohort type with specified lock types
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_cohort.h
+.Fn CK_COHORT_TRYLOCK_PROTOTYPE "COHORT_NAME cohort_name" "LOCK_FXN global_lock_method" \
+"LOCK_FXN global_unlock_method" "BOOL_LOCK_FXN global_locked_method" \
+"BOOL_LOCK_FXN global_trylock_method" "LOCK_FXN local_lock_method" \
+"LOCK_FXN local_unlock_method" "BOOL_LOCK_FXN local_locked_method" "BOOL_LOCK_FXN local_trylock_method"
+.Sh DESCRIPTION
+The ck_cohort.h header file does not define any cohort types. Instead, the user must use
+the CK_COHORT_PROTOTYPE or CK_COHORT_TRYLOCK_PROTOTYPE macros to define any types
+they want to use. They must use CK_COHORT_TRYLOCK_PROTOTYPE if they want their cohort type to have support
+for trylock operations. The CK_COHORT_TRYLOCK_PROTOTYPE macro takes the following arguments:
+.Pp
+.Fa cohort_name
+: An identifier used for this cohort type. This will have to be passed to each
+of the other CK_COHORT macros.
+.br
+.Fa global_lock_method
+: The method that should be called to acquire the global lock
+.br
+.Fa global_unlock_method
+: The method that should be called to relinquish the global lock
+.br
+.Fa global_locked_method
+: This method should return true iff the global lock is acquired by a thread.
+.br
+.Fa global_trylock_method
+: The method that should be called to try to acquire the global lock.
+It should not block and return true iff the lock was successfully acquired.
+.br
+.Fa local_lock_method
+: The method that should be called to acquire the local lock
+.br
+.Fa local_unlock_method
+: The method that should be called to relinquish the local lock
+.br
+.Fa global_locked_method
+: This method should return true iff the global lock is acquired by a thread.
+.br
+.Fa local_trylock_method
+: The method that should be called to try to acquire the local lock.
+It should not block and return true iff the lock was successfully acquired.
+.Pp
+Instances of the defined cohort type can be declared as:
+.br
+ CK_COHORT_INSTANCE(cohort_name) cohort;
+.Sh SEE ALSO
+.Xr ck_cohort 3 ,
+.Xr CK_COHORT_PROTOTYPE 3 ,
+.Xr CK_COHORT_INSTANCE 3 ,
+.Xr CK_COHORT_INITIALIZER 3 ,
+.Xr CK_COHORT_INIT 3 ,
+.Xr CK_COHORT_LOCK 3 ,
+.Xr CK_COHORT_UNLOCK 3 ,
+.Xr CK_COHORT_LOCKED 3 ,
+.Xr CK_COHORT_TRYLOCK 3 ,
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/CK_COHORT_UNLOCK b/doc/CK_COHORT_UNLOCK
new file mode 100644
index 000000000000..a9f302fb68ef
--- /dev/null
+++ b/doc/CK_COHORT_UNLOCK
@@ -0,0 +1,61 @@
+.\"
+.\" Copyright 2013 Brendon Scheinman.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd February 24, 2013.
+.Dt CK_COHORT_UNLOCK 3
+.Sh NAME
+.Nm CK_COHORT_UNLOCK
+.Nd release cohort lock
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_cohort.h
+.Fn CK_COHORT_UNLOCK "COHORT_NAME cohort_name" "COHORT *cohort" "void *global_context" \
+"void *local_context"
+.Sh DESCRIPTION
+This call instructs
+.Fa cohort
+to relinquish its local lock and potentially its global lock as well.
+.Fa global_context
+will be passed as the second argument to the function that was provided as the
+.Fa global_lock_method
+argument to CK_COHORT_PROTOTYPE if that method is called, and
+.Fa local_context
+will be passed to the function specified by
+.Fa local_lock_method
+.
+.Sh SEE ALSO
+.Xr ck_cohort 3 ,
+.Xr CK_COHORT_PROTOTYPE 3 ,
+.Xr CK_COHORT_TRYLOCK_PROTOTYPE 3 ,
+.Xr CK_COHORT_INSTANCE 3 ,
+.Xr CK_COHORT_INITIALIZER 3 ,
+.Xr CK_COHORT_INIT 3 ,
+.Xr CK_COHORT_LOCK 3 ,
+.Xr CK_COHORT_LOCKED 3 ,
+.Xr CK_COHORT_TRYLOCK 3 ,
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/CK_HS_HASH b/doc/CK_HS_HASH
new file mode 100644
index 000000000000..6d8dc753faec
--- /dev/null
+++ b/doc/CK_HS_HASH
@@ -0,0 +1,71 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd March 28, 2012
+.Dt CK_HS_HASH 3
+.Sh NAME
+.Nm CK_HS_HASH
+.Nd invoke hash function with hash set seed
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_hs.h
+.Ft unsigned long
+.Fn CK_HS_HASH "ck_hs_t *hs" "ck_hs_hash_cb_t *hf" "const void *key"
+.Sh DESCRIPTION
+The
+.Fn CK_HS_HASH 3
+macro will invoke the hash function pointed to by the
+.Fa hf
+argument with the seed value associated with
+.Fa hs
+and the key pointer specified by the
+.Fa key
+argument.
+.Sh RETURN VALUES
+This function will return the value returned by the
+.Fa hf
+function.
+.Sh ERRORS
+It is expected
+.Fa hs
+was previously initialized via
+.Fn ck_hs_init 3 .
+.Sh SEE ALSO
+.Xr ck_hs_init 3 ,
+.Xr ck_hs_destroy 3 ,
+.Xr ck_hs_iterator_init 3 ,
+.Xr ck_hs_next 3 ,
+.Xr ck_hs_get 3 ,
+.Xr ck_hs_put 3 ,
+.Xr ck_hs_set 3 ,
+.Xr ck_hs_remove 3 ,
+.Xr ck_hs_grow 3 ,
+.Xr ck_hs_count 3 ,
+.Xr ck_hs_reset 3 ,
+.Xr ck_hs_stat 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/CK_RHS_HASH b/doc/CK_RHS_HASH
new file mode 100644
index 000000000000..43b88593e11d
--- /dev/null
+++ b/doc/CK_RHS_HASH
@@ -0,0 +1,71 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd March 28, 2012
+.Dt CK_RHS_HASH 3
+.Sh NAME
+.Nm CK_RHS_HASH
+.Nd invoke hash function with hash set seed
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_rhs.h
+.Ft unsigned long
+.Fn CK_RHS_HASH "ck_rhs_t *hs" "ck_rhs_hash_cb_t *hf" "const void *key"
+.Sh DESCRIPTION
+The
+.Fn CK_RHS_HASH 3
+macro will invoke the hash function pointed to by the
+.Fa hf
+argument with the seed value associated with
+.Fa hs
+and the key pointer specified by the
+.Fa key
+argument.
+.Sh RETURN VALUES
+This function will return the value returned by the
+.Fa hf
+function.
+.Sh ERRORS
+It is expected
+.Fa hs
+was previously initialized via
+.Fn ck_rhs_init 3 .
+.Sh SEE ALSO
+.Xr ck_rhs_init 3 ,
+.Xr ck_rhs_destroy 3 ,
+.Xr ck_rhs_iterator_init 3 ,
+.Xr ck_rhs_next 3 ,
+.Xr ck_rhs_get 3 ,
+.Xr ck_rhs_put 3 ,
+.Xr ck_rhs_set 3 ,
+.Xr ck_rhs_remove 3 ,
+.Xr ck_rhs_grow 3 ,
+.Xr ck_rhs_count 3 ,
+.Xr ck_rhs_reset 3 ,
+.Xr ck_rhs_stat 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/CK_RWCOHORT_INIT b/doc/CK_RWCOHORT_INIT
new file mode 100644
index 000000000000..18d1b33508cc
--- /dev/null
+++ b/doc/CK_RWCOHORT_INIT
@@ -0,0 +1,61 @@
+.\"
+.\" Copyright 2013 Brendon Scheinman.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd February 24, 2013.
+.Dt CK_RWCOHORT_INIT 3
+.Sh NAME
+.Nm CK_RWCOHORT_INIT
+.Nd initialize instance of a cohort-based reader-writer lock type
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_rwcohort.h
+.Fn CK_RWCOHORT_NEUTRAL_INIT "COHORT_NAME cohort_name" "LOCK *lock"
+.Fn CK_RWCOHORT_RP_INIT "COHORT_NAME cohort_name" "LOCK *lock" "unsigned int wait_limit"
+.Fn CK_RWCOHORT_WP_INIT "COHORT_NAME cohort_name" "LOCK *lock" "unsigned int wait_limit"
+.Sh DESCRIPTION
+This macro initializes the lock instance pointed to by the
+.Fa lock
+argument. Until a lock instance is initialized using the CK_RWCOHORT_INIT macro, any operations
+involving it will have undefined behavior. Note that the
+.Fa wait_limit
+argument should only be used with reader-preference or writer-preference locks. For neutral
+locks, this argument should be excluded.
+If you are unsure of a value to use for the
+.Fa wait_limit
+argument, you should use CK_RWCOHORT_STRATEGY_DEFAULT_LOCAL_WAIT_LIMIT.
+.Sh SEE ALSO
+.Xr ck_rwcohort 3 ,
+.Xr CK_RWCOHORT_PROTOTYPE 3 ,
+.Xr CK_RWCOHORT_TRYLOCK_PROTOTYPE 3 ,
+.Xr CK_RWCOHORT_INSTANCE 3 ,
+.Xr CK_RWCOHORT_INITIALIZER 3 ,
+.Xr CK_RWCOHORT_LOCK 3 ,
+.Xr CK_RWCOHORT_UNLOCK 3 ,
+.Xr CK_RWCOHORT_LOCKED 3 ,
+.Xr CK_RWCOHORT_TRYLOCK 3 ,
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/CK_RWCOHORT_INSTANCE b/doc/CK_RWCOHORT_INSTANCE
new file mode 100644
index 000000000000..10251a3f56d3
--- /dev/null
+++ b/doc/CK_RWCOHORT_INSTANCE
@@ -0,0 +1,64 @@
+.\"
+.\" Copyright 2013 Brendon Scheinman.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd February 24, 2013.
+.Dt CK_RWCOHORT_INSTANCE 3
+.Sh NAME
+.Nm CK_RWCOHORT_INSTANCE
+.Nd declare an instance of a cohort-based reader-writer lock type
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_cohort.h
+.Fn CK_RWCOHORT_NEUTRAL_INSTANCE "COHORT_NAME cohort_name"
+.Fn CK_RWCOHORT_RP_INSTANCE "COHORT_NAME cohort_name"
+.Fn CK_RWCOHORT_WP_INSTANCE "COHORT_NAME cohort_name"
+.Sh DESCRIPTION
+The user must use this macro to declare instances of lock types that they have
+defined using the
+.Xr CK_RWCOHORT_PROTOTYPE 3
+macro. The cohort_name must be the same as the one used in the prototype macro.
+For instance, if CK_RWCOHORT_PROTOTYPE was called with the name "foo", the
+CK_RWCOHORT_INSTANCE macro should be called as
+.br
+CK_RWCOHORT_INSTANCE(foo) cohort;
+.Pp
+This macro should also be used when allocating memory for cohorts. For instance,
+to allocate a block of 4 cohorts:
+.br
+CK_RWCOHORT_WP_INSTANCE(foo) *cohorts = malloc(4 * sizeof(CK_RWCOHORT_WP_INSTANCE(foo)));
+.Sh SEE ALSO
+.Xr ck_rwcohort 3 ,
+.Xr CK_RWCOHORT_PROTOTYPE 3 ,
+.Xr CK_RWCOHORT_TRYLOCK_PROTOTYPE 3 ,
+.Xr CK_RWCOHORT_INSTANCE 3 ,
+.Xr CK_RWCOHORT_INITIALIZER 3 ,
+.Xr CK_RWCOHORT_LOCK 3 ,
+.Xr CK_RWCOHORT_UNLOCK 3 ,
+.Xr CK_RWCOHORT_LOCKED 3 ,
+.Xr CK_RWCOHORT_TRYLOCK 3 ,
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/CK_RWCOHORT_PROTOTYPE b/doc/CK_RWCOHORT_PROTOTYPE
new file mode 100644
index 000000000000..a2705b63403b
--- /dev/null
+++ b/doc/CK_RWCOHORT_PROTOTYPE
@@ -0,0 +1,65 @@
+.\"
+.\" Copyright 2013 Brendon Scheinman.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd February 24, 2013.
+.Dt CK_RWCOHORT_PROTOTYPE 3
+.Sh NAME
+.Nm CK_RWCOHORT_PROTOTYPE
+.Nd define reader-writer cohort-based lock using the specified cohort type
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_rwcohort.h
+.Fn CK_RWCOHORT_NEUTRAL_PROTOTYPE "COHORT_NAME cohort_name"
+.Fn CK_RWCOHORT_RP_PROTOTYPE "COHORT_NAME cohort_name"
+.Fn CK_RWCOHORT_WP_PROTOTYPE "COHORT_NAME cohort_name"
+.Sh DESCRIPTION
+The ck_rwcohort.h header file does not define any cohort types. Instead, the user must use
+the CK_RWCOHORT_PROTOTYPE macro to define any types they want to use.
+This macro takes a single argument which corresponds to the type of the cohort lock that
+the reader-writer lock should use. A cohort type must have already been defined with that name
+using the
+.Xr CK_COHORT_PROTOTYPE 3
+or
+.Xr CK_COHORT_TRYLOCK_PROTOTYPE 3
+macros.
+.Pp
+Instances of the defined lock type can be declared as:
+.br
+ CK_RWCOHORT_INSTANCE(cohort_name) lock;
+.Sh SEE ALSO
+.Xr ck_rwcohort 3 ,
+.Xr CK_COHORT_PROTOTYPE 3 ,
+.Xr CK_COHORT_TRYLOCK_PROTOTYPE 3 ,
+.Xr CK_RWCOHORT_INSTANCE 3 ,
+.Xr CK_RWCOHORT_INITIALIZER 3 ,
+.Xr CK_RWCOHORT_INIT 3 ,
+.Xr CK_RWCOHORT_READ_LOCK 3 ,
+.Xr CK_RWCOHORT_READ_UNLOCK 3 ,
+.Xr CK_RWCOHORT_WRITE_LOCK 3 ,
+.Xr CK_RWCOHORT_WRITE_UNLOCK 3 ,
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/CK_RWCOHORT_READ_LOCK b/doc/CK_RWCOHORT_READ_LOCK
new file mode 100644
index 000000000000..62831ea36a53
--- /dev/null
+++ b/doc/CK_RWCOHORT_READ_LOCK
@@ -0,0 +1,66 @@
+.\"
+.\" Copyright 2013 Brendon Scheinman.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd February 24, 2013.
+.Dt CK_RWCOHORT_READ_LOCK 3
+.Sh NAME
+.Nm CK_RWCOHORT_READ_LOCK
+.Nd acquire read-only permission for cohort-based reader-writer lock
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_cohort.h
+.Fn CK_RWCOHORT_NEUTRAL_READ_LOCK "COHORT_NAME cohort_name" "LOCK *lock" "COHORT *cohort"\
+"void *global_context" "void *local_context"
+.Fn CK_RWCOHORT_RP_READ_LOCK "COHORT_NAME cohort_name" "LOCK *lock" "COHORT *cohort"\
+"void *global_context" "void *local_context"
+.Fn CK_RWCOHORT_WP_READ_LOCK "COHORT_NAME cohort_name" "LOCK *lock" "COHORT *cohort"\
+"void *global_context" "void *local_context"
+.Sh DESCRIPTION
+This call will acquire read-only permission from
+.Fa lock .
+The call will block until this permission has been acquired.
+.Fa cohort
+must point to a cohort whose global lock is the same as all other cohorts used with
+.Fa lock .
+The
+.Fa global_context
+and
+.Fa local_context
+arguments will be passed along as the context arguments to any calls to
+.Fa cohort .
+.
+.Sh SEE ALSO
+.Xr ck_cohort 3 ,
+.Xr CK_RWCOHORT_PROTOTYPE 3 ,
+.Xr CK_RWCOHORT_INSTANCE 3 ,
+.Xr CK_RWCOHORT_INITIALIZER 3 ,
+.Xr CK_RWCOHORT_INIT 3 ,
+.Xr CK_RWCOHORT_READ_UNLOCK 3 ,
+.Xr CK_RWCOHORT_WRITE_LOCK 3 ,
+.Xr CK_RWCOHORT_WRITE_UNLOCK 3 ,
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/CK_RWCOHORT_READ_UNLOCK b/doc/CK_RWCOHORT_READ_UNLOCK
new file mode 100644
index 000000000000..1c818014ca04
--- /dev/null
+++ b/doc/CK_RWCOHORT_READ_UNLOCK
@@ -0,0 +1,65 @@
+.\"
+.\" Copyright 2013 Brendon Scheinman.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd February 24, 2013.
+.Dt CK_RWCOHORT_READ_UNLOCK 3
+.Sh NAME
+.Nm CK_RWCOHORT_READ_UNLOCK
+.Nd relinquish read-only access to cohort-based reader-writer lock
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_cohort.h
+.Fn CK_RWCOHORT_NEUTRAL_READ_UNLOCK "COHORT_NAME cohort_name" "LOCK *lock" "COHORT *cohort"\
+"void *global_context" "void *local_context"
+.Fn CK_RWCOHORT_RP_READ_UNLOCK "COHORT_NAME cohort_name" "LOCK *lock" "COHORT *cohort"\
+"void *global_context" "void *local_context"
+.Fn CK_RWCOHORT_WP_READ_UNLOCK "COHORT_NAME cohort_name" "LOCK *lock" "COHORT *cohort"\
+"void *global_context" "void *local_context"
+.Sh DESCRIPTION
+This call will relinquish read-only permission to
+.Fa lock .
+.Fa cohort
+must point to a cohort whose global lock is the same as all other cohorts used with
+.Fa lock .
+The
+.Fa global_context
+and
+.Fa local_context
+arguments will be passed along as the context arguments to any calls to
+.Fa cohort .
+.
+.Sh SEE ALSO
+.Xr ck_cohort 3 ,
+.Xr CK_RWCOHORT_PROTOTYPE 3 ,
+.Xr CK_RWCOHORT_INSTANCE 3 ,
+.Xr CK_RWCOHORT_INITIALIZER 3 ,
+.Xr CK_RWCOHORT_INIT 3 ,
+.Xr CK_RWCOHORT_READ_LOCK 3 ,
+.Xr CK_RWCOHORT_WRITE_LOCK 3 ,
+.Xr CK_RWCOHORT_WRITE_UNLOCK 3 ,
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/CK_RWCOHORT_WRITE_LOCK b/doc/CK_RWCOHORT_WRITE_LOCK
new file mode 100644
index 000000000000..161c7bb3dce3
--- /dev/null
+++ b/doc/CK_RWCOHORT_WRITE_LOCK
@@ -0,0 +1,66 @@
+.\"
+.\" Copyright 2013 Brendon Scheinman.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd February 24, 2013.
+.Dt CK_RWCOHORT_WRITE_LOCK 3
+.Sh NAME
+.Nm CK_RWCOHORT_WRITE_LOCK
+.Nd acquite write access for a cohort-based reader-writer lock
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_cohort.h
+.Fn CK_RWCOHORT_NEUTRAL_WRITE_LOCK "COHORT_NAME cohort_name" "LOCK *lock" "COHORT *cohort"\
+"void *global_context" "void *local_context"
+.Fn CK_RWCOHORT_RP_WRITE_LOCK "COHORT_NAME cohort_name" "LOCK *lock" "COHORT *cohort"\
+"void *global_context" "void *local_context"
+.Fn CK_RWCOHORT_WP_WRITE_LOCK "COHORT_NAME cohort_name" "LOCK *lock" "COHORT *cohort"\
+"void *global_context" "void *local_context"
+.Sh DESCRIPTION
+This call will acquire write permission for
+.Fa lock .
+The call will block until this permission has been acquired.
+.Fa cohort
+must point to a cohort whose global lock is the same as all other cohorts used with
+.Fa lock .
+The
+.Fa global_context
+and
+.Fa local_context
+arguments will be passed along as the context arguments to any calls to
+.Fa cohort .
+.
+.Sh SEE ALSO
+.Xr ck_cohort 3 ,
+.Xr CK_RWCOHORT_PROTOTYPE 3 ,
+.Xr CK_RWCOHORT_INSTANCE 3 ,
+.Xr CK_RWCOHORT_INITIALIZER 3 ,
+.Xr CK_RWCOHORT_INIT 3 ,
+.Xr CK_RWCOHORT_READ_LOCK 3 ,
+.Xr CK_RWCOHORT_READ_UNLOCK 3 ,
+.Xr CK_RWCOHORT_WRITE_UNLOCK 3 ,
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/CK_RWCOHORT_WRITE_UNLOCK b/doc/CK_RWCOHORT_WRITE_UNLOCK
new file mode 100644
index 000000000000..5772a9faf6bb
--- /dev/null
+++ b/doc/CK_RWCOHORT_WRITE_UNLOCK
@@ -0,0 +1,65 @@
+.\"
+.\" Copyright 2013 Brendon Scheinman.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd February 24, 2013.
+.Dt CK_RWCOHORT_WRITE_UNLOCK 3
+.Sh NAME
+.Nm CK_RWCOHORT_WRITE_UNLOCK
+.Nd relinquish write access for cohort-based reader-writer lock
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_cohort.h
+.Fn CK_RWCOHORT_NEUTRAL_WRITE_UNLOCK "COHORT_NAME cohort_name" "LOCK *lock" "COHORT *cohort"\
+"void *global_context" "void *local_context"
+.Fn CK_RWCOHORT_RP_WRITE_UNLOCK "COHORT_NAME cohort_name" "LOCK *lock" "COHORT *cohort"\
+"void *global_context" "void *local_context"
+.Fn CK_RWCOHORT_WP_WRITE_UNLOCK "COHORT_NAME cohort_name" "LOCK *lock" "COHORT *cohort"\
+"void *global_context" "void *local_context"
+.Sh DESCRIPTION
+This call will relinquish write permission for
+.Fa lock .
+.Fa cohort
+must point to a cohort whose global lock is the same as all other cohorts used with
+.Fa lock .
+The
+.Fa global_context
+and
+.Fa local_context
+arguments will be passed along as the context arguments to any calls to
+.Fa cohort .
+.
+.Sh SEE ALSO
+.Xr ck_cohort 3 ,
+.Xr CK_RWCOHORT_PROTOTYPE 3 ,
+.Xr CK_RWCOHORT_INSTANCE 3 ,
+.Xr CK_RWCOHORT_INITIALIZER 3 ,
+.Xr CK_RWCOHORT_INIT 3 ,
+.Xr CK_RWCOHORT_READ_LOCK 3 ,
+.Xr CK_RWCOHORT_READ_UNLOCK 3 ,
+.Xr CK_RWCOHORT_WRITE_LOCK 3 ,
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/Makefile.in b/doc/Makefile.in
new file mode 100644
index 000000000000..cbad704b709f
--- /dev/null
+++ b/doc/Makefile.in
@@ -0,0 +1,218 @@
+.PHONY: clean install uninstall
+
+MANDIR=@MANDIR@
+GZIP=@GZIP@
+GZIP_SUFFIX=.3@GZIP_SUFFIX@
+BUILD_DIR=@BUILD_DIR@
+SRC_DIR=@SRC_DIR@
+HTML_SUFFIX=.html
+
+OBJECTS=CK_ARRAY_FOREACH \
+ ck_array_buffer \
+ ck_array_commit \
+ ck_array_deinit \
+ ck_array_init \
+ ck_array_initialized \
+ ck_array_length \
+ ck_array_put \
+ ck_array_put_unique \
+ ck_array_remove \
+ ck_array_deinit \
+ ck_brlock \
+ ck_ht_count \
+ ck_ht_destroy \
+ ck_ht_gc \
+ ck_ht_get_spmc \
+ ck_ht_grow_spmc \
+ ck_ht_hash \
+ ck_ht_hash_direct \
+ ck_ht_init \
+ ck_ht_put_spmc \
+ ck_ht_remove_spmc \
+ ck_ht_reset_spmc \
+ ck_ht_reset_size_spmc \
+ ck_ht_set_spmc \
+ ck_ht_entry_empty \
+ ck_ht_entry_key \
+ ck_ht_entry_key_direct \
+ ck_ht_entry_key_length \
+ ck_ht_entry_key_set \
+ ck_ht_entry_key_set_direct \
+ ck_ht_entry_set \
+ ck_ht_entry_set_direct \
+ ck_ht_entry_value_direct \
+ ck_ht_entry_value \
+ ck_ht_iterator_init \
+ ck_ht_next \
+ ck_ht_stat \
+ ck_bitmap_init \
+ ck_bitmap_reset \
+ ck_bitmap_set \
+ ck_bitmap_bts \
+ ck_bitmap_test \
+ ck_bitmap_base \
+ ck_bitmap_union \
+ ck_bitmap_size \
+ ck_bitmap_clear \
+ ck_bitmap_bits \
+ ck_bitmap_buffer \
+ ck_bitmap_next \
+ ck_bitmap_iterator_init \
+ ck_elide \
+ ck_epoch_barrier \
+ ck_epoch_begin \
+ ck_epoch_call \
+ ck_epoch_end \
+ ck_epoch_init \
+ ck_epoch_poll \
+ ck_epoch_recycle \
+ ck_epoch_register \
+ ck_epoch_reclaim \
+ ck_epoch_synchronize \
+ ck_epoch_unregister \
+ ck_hs_gc \
+ ck_hs_init \
+ ck_hs_destroy \
+ CK_HS_HASH \
+ ck_hs_apply \
+ ck_hs_iterator_init \
+ ck_hs_next \
+ ck_hs_get \
+ ck_hs_put \
+ ck_hs_put_unique \
+ ck_hs_set \
+ ck_hs_fas \
+ ck_hs_remove \
+ ck_hs_move \
+ ck_hs_grow \
+ ck_hs_rebuild \
+ ck_hs_count \
+ ck_hs_reset \
+ ck_hs_reset_size \
+ ck_hs_stat \
+ ck_rhs_gc \
+ ck_rhs_init \
+ ck_rhs_destroy \
+ CK_RHS_HASH \
+ ck_rhs_apply \
+ ck_rhs_iterator_init \
+ ck_rhs_next \
+ ck_rhs_get \
+ ck_rhs_put \
+ ck_rhs_put_unique \
+ ck_rhs_set \
+ ck_rhs_fas \
+ ck_rhs_remove \
+ ck_rhs_move \
+ ck_rhs_grow \
+ ck_rhs_rebuild \
+ ck_rhs_count \
+ ck_rhs_reset \
+ ck_rhs_reset_size \
+ ck_rhs_stat \
+ ck_rwcohort \
+ CK_RWCOHORT_INIT \
+ CK_RWCOHORT_INSTANCE \
+ CK_RWCOHORT_PROTOTYPE \
+ CK_RWCOHORT_READ_LOCK \
+ CK_RWCOHORT_READ_UNLOCK \
+ CK_RWCOHORT_WRITE_LOCK \
+ CK_RWCOHORT_WRITE_UNLOCK \
+ ck_cohort \
+ CK_COHORT_PROTOTYPE \
+ CK_COHORT_TRYLOCK_PROTOTYPE \
+ CK_COHORT_INSTANCE \
+ CK_COHORT_INIT \
+ CK_COHORT_LOCK \
+ CK_COHORT_UNLOCK \
+ CK_COHORT_TRYLOCK \
+ ck_pr \
+ ck_pr_fence_acquire \
+ ck_pr_fence_release \
+ ck_pr_barrier \
+ ck_pr_fas \
+ ck_pr_fence_atomic \
+ ck_pr_fence_atomic_load \
+ ck_pr_fence_atomic_store \
+ ck_pr_fence_load \
+ ck_pr_fence_load_atomic \
+ ck_pr_fence_load_store \
+ ck_pr_fence_load_depends \
+ ck_pr_fence_memory \
+ ck_pr_fence_store \
+ ck_pr_fence_store_atomic \
+ ck_pr_fence_store_load \
+ ck_pr_stall \
+ ck_pr_faa \
+ ck_pr_inc \
+ ck_pr_dec \
+ ck_pr_not \
+ ck_pr_neg \
+ ck_pr_add \
+ ck_pr_sub \
+ ck_pr_and \
+ ck_pr_xor \
+ ck_pr_or \
+ ck_pr_cas \
+ ck_pr_bts \
+ ck_pr_btc \
+ ck_pr_btr \
+ ck_pr_store \
+ ck_pr_load \
+ ck_pr_rtm \
+ ck_queue \
+ ck_ring_init \
+ ck_ring_dequeue_spmc \
+ ck_ring_enqueue_spmc \
+ ck_ring_enqueue_spmc_size \
+ ck_ring_trydequeue_spmc \
+ ck_ring_dequeue_spsc \
+ ck_ring_enqueue_spsc \
+ ck_ring_enqueue_spsc_size \
+ ck_ring_size \
+ ck_ring_capacity \
+ ck_tflock \
+ ck_rwlock \
+ ck_pflock \
+ ck_swlock \
+ ck_sequence \
+ ck_spinlock
+
+all:
+ for target in $(OBJECTS); do \
+ $(GZIP) $(SRC_DIR)/doc/$$target > $(BUILD_DIR)/doc/$$target$(GZIP_SUFFIX); \
+ done
+
+html:
+ for target in $(OBJECTS); do \
+ echo $$target; \
+ groff -man -Tascii $(SRC_DIR)/doc/$$target | col -bx > \
+ $(BUILD_DIR)/doc/$$target$(HTML_SUFFIX); \
+ sed -i.bk 's/\&/\&amp\;/g;s/>/\&gt\;/g;s/</\&lt\;/g;' \
+ $(BUILD_DIR)/doc/$$target$(HTML_SUFFIX); \
+ done
+
+# check for entries that are missing in OBJECTS
+objcheck: all
+ for file in `ls * | egrep '(ck|CK)_' | egrep -v "($(GZIP_SUFFIX)|$(HTML_SUFFIX))$$"`; do \
+ if [ ! -f $${file}$(GZIP_SUFFIX) ]; then \
+ echo "$$file is missing from OBJECTS" >&2; \
+ fi; \
+ done
+
+# check for stale references
+refcheck:
+ @./refcheck.pl $(OBJECTS)
+
+install:
+ mkdir -p $(DESTDIR)/$(MANDIR)/man3 || exit
+ cp *$(GZIP_SUFFIX) $(DESTDIR)/$(MANDIR)/man3 || exit
+
+uninstall:
+ for target in $(OBJECTS); do \
+ rm -f $(DESTDIR)/$(MANDIR)/man3/$$target$(GZIP_SUFFIX); \
+ done
+
+clean:
+ rm -f $(BUILD_DIR)/doc/*~ $(BUILD_DIR)/doc/*$(GZIP_SUFFIX) $(BUILD_DIR)/doc/*$(HTML_SUFFIX)
+
diff --git a/doc/ck_array_buffer b/doc/ck_array_buffer
new file mode 100644
index 000000000000..7a8ded33a358
--- /dev/null
+++ b/doc/ck_array_buffer
@@ -0,0 +1,60 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd October 18, 2013
+.Dt CK_ARRAY_BUFFER 3
+.Sh NAME
+.Nm ck_array_buffer
+.Nd return length and pointer to array of reader-visible pointers
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_array.h
+.Ft void *
+.Fn ck_array_buffer "ck_array_t *array" "unsigned int *length"
+.Sh DESCRIPTION
+The
+.Fn ck_array_buffer 3
+returns a pointer to the array of pointers currently visible
+to readers after the last commit operation in
+.Fa array .
+The unsigned integer pointed to by
+.Fa length
+is updated to reflect the length of the array.
+.Sh RETURN VALUES
+This function returns a pointer to an array of pointers.
+.Sh SEE ALSO
+.Xr ck_array_commit 3 ,
+.Xr ck_array_put 3 ,
+.Xr ck_array_put_unique 3 ,
+.Xr ck_array_remove 3 ,
+.Xr ck_array_init 3
+.Xr ck_array_deinit 3 ,
+.Xr ck_array_length 3 ,
+.Xr ck_array_initialized 3 ,
+.Xr CK_ARRAY_FOREACH 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_array_commit b/doc/ck_array_commit
new file mode 100644
index 000000000000..0fc1192e8f5e
--- /dev/null
+++ b/doc/ck_array_commit
@@ -0,0 +1,58 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd October 18, 2013
+.Dt CK_ARRAY_COMMIT 3
+.Sh NAME
+.Nm ck_array_commit
+.Nd linearization point for mutations before commit call
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_array.h
+.Ft bool
+.Fn ck_array_commit "ck_array_t *array"
+.Sh DESCRIPTION
+The
+.Fn ck_array_commit 3
+function will commit any pending put or remove operations associated
+with the array. The function may end up requesting the safe reclamation
+of memory actively being iterated upon by other threads.
+.Sh RETURN VALUES
+This function returns true if the commit operation succeeded. It will
+return false otherwise, and pending operations will not be applied.
+.Sh SEE ALSO
+.Xr ck_array_init 3 ,
+.Xr ck_array_put 3 ,
+.Xr ck_array_put_unique 3 ,
+.Xr ck_array_remove 3 ,
+.Xr ck_array_deinit 3
+.Xr ck_array_length 3 ,
+.Xr ck_array_buffer 3 ,
+.Xr ck_array_initialized 3 ,
+.Xr CK_ARRAY_FOREACH 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_array_deinit b/doc/ck_array_deinit
new file mode 100644
index 000000000000..3a5e5ab90bbb
--- /dev/null
+++ b/doc/ck_array_deinit
@@ -0,0 +1,62 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd October 18, 2013
+.Dt CK_ARRAY_DEINIT 3
+.Sh NAME
+.Nm ck_array_deinit
+.Nd destroy and deinitialize a pointer array
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_array.h
+.Ft void
+.Fn ck_array_deinit "ck_array_t *array" "bool defer"
+.Sh DESCRIPTION
+The
+.Fn ck_array_deinit 3
+destroys the memory associated with the array pointed
+to by
+.Fa array .
+The
+.Fa defer
+argument is true if the allocator must destroy
+the memory using safe memory reclamation or false
+if the allocator can destroy this memory immediately.
+.Sh RETURN VALUES
+This function has no return value.
+.Sh SEE ALSO
+.Xr ck_array_commit 3 ,
+.Xr ck_array_put 3 ,
+.Xr ck_array_put_unique 3 ,
+.Xr ck_array_remove 3 ,
+.Xr ck_array_init 3
+.Xr ck_array_length 3 ,
+.Xr ck_array_buffer 3 ,
+.Xr ck_array_initialized 3 ,
+.Xr CK_ARRAY_FOREACH 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_array_init b/doc/ck_array_init
new file mode 100644
index 000000000000..ad8a9fe57b72
--- /dev/null
+++ b/doc/ck_array_init
@@ -0,0 +1,69 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd October 18, 2013
+.Dt CK_ARRAY_INIT 3
+.Sh NAME
+.Nm ck_array_init
+.Nd initialize a pointer array
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_array.h
+.Ft bool
+.Fn ck_array_init "ck_array_t *array" "unsigned int mode" "struct ck_malloc *allocator" "unsigned int initial_length"
+.Sh DESCRIPTION
+The
+.Fn ck_array_init 3
+function initializes the array pointed to by the argument
+.Fa array .
+The mode value must be
+.Dv CK_ARRAY_MODE_SPMC .
+The
+.Fa allocator
+argument must point to a ck_malloc data structure with valid non-NULL function pointers
+initialized for malloc, free and realloc. The
+.Fa initial_length
+specifies the initial length of the array. The value of
+.Fa initial_length
+must be greater than or equal to 2. An array allows for one concurrent put or remove operations
+in the presence of any number of concurrent CK_ARRAY_FOREACH operations.
+.Sh RETURN VALUES
+This function returns true if the array was successfully created. It returns
+false if the creation failed. Failure may occur due to internal memory allocation
+failures or invalid arguments.
+.Sh SEE ALSO
+.Xr ck_array_commit 3 ,
+.Xr ck_array_put 3 ,
+.Xr ck_array_put_unique 3 ,
+.Xr ck_array_remove 3 ,
+.Xr ck_array_deinit 3
+.Xr ck_array_length 3 ,
+.Xr ck_array_buffer 3 ,
+.Xr ck_array_initialized 3 ,
+.Xr CK_ARRAY_FOREACH 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_array_initialized b/doc/ck_array_initialized
new file mode 100644
index 000000000000..3a064139e0ed
--- /dev/null
+++ b/doc/ck_array_initialized
@@ -0,0 +1,62 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd October 18, 2013
+.Dt CK_ARRAY_INITIALIZED 3
+.Sh NAME
+.Nm ck_array_initialized
+.Nd indicates whether an array was recently initialized or deinitialized
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_array.h
+.Ft bool
+.Fn ck_array_initialized "ck_array_t *array"
+.Sh DESCRIPTION
+The
+.Fn ck_array_initialized 3
+can be used to determine whether an array was recently initialized
+with
+.Fn ck_array_init 3
+or deinitialized with
+.Fn ck_array_deinit 3 .
+Behavior is undefined if a user allocates internal allocator data
+in through other means.
+.Sh RETURN VALUES
+This function returns true if the array is initialized, and false
+otherwise.
+.Sh SEE ALSO
+.Xr ck_array_commit 3 ,
+.Xr ck_array_put 3 ,
+.Xr ck_array_put_unique 3 ,
+.Xr ck_array_remove 3 ,
+.Xr ck_array_init 3
+.Xr ck_array_deinit 3 ,
+.Xr ck_array_length 3 ,
+.Xr ck_array_buffer 3 ,
+.Xr CK_ARRAY_FOREACH 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_array_length b/doc/ck_array_length
new file mode 100644
index 000000000000..e60c6c3bc00f
--- /dev/null
+++ b/doc/ck_array_length
@@ -0,0 +1,57 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd October 18, 2013
+.Dt CK_ARRAY_LENGTH 3
+.Sh NAME
+.Nm ck_array_length
+.Nd returns the number of pointers committed to an array
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_array.h
+.Ft unsigned int
+.Fn ck_array_length "ck_array_t *array"
+.Sh DESCRIPTION
+The
+.Fn ck_array_length 3
+function returns the number of items a concurrent
+traversal operation would encounter at completion
+time.
+.Sh RETURN VALUES
+The number of traversal-visible pointers is returned.
+.Sh SEE ALSO
+.Xr ck_array_commit 3 ,
+.Xr ck_array_put 3 ,
+.Xr ck_array_put_unique 3 ,
+.Xr ck_array_remove 3 ,
+.Xr ck_array_init 3
+.Xr ck_array_deinit 3 ,
+.Xr ck_array_buffer 3 ,
+.Xr ck_array_initialized 3 ,
+.Xr CK_ARRAY_FOREACH 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_array_put b/doc/ck_array_put
new file mode 100644
index 000000000000..0f74eb06b80d
--- /dev/null
+++ b/doc/ck_array_put
@@ -0,0 +1,65 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd October 18, 2013
+.Dt CK_ARRAY_PUT 3
+.Sh NAME
+.Nm ck_array_put
+.Nd attempt immediate or deferred insertion of a pointer into array
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_array.h
+.Ft bool
+.Fn ck_array_put "ck_array_t *array" "void *pointer"
+.Sh DESCRIPTION
+The
+.Fn ck_array_put 3
+function will attempt to insert the value of
+.Fa pointer
+into the array pointed to by
+.Fa array .
+This function may incur additional memory allocations
+if not enough memory has been allocated in the array
+for a new entry. The operation is also free to apply
+the operation immediately if there is an opportunity
+for elimination with a pending (uncommitted) remove
+operation.
+.Sh RETURN VALUES
+This function returns true if the put operation succeeded. It will
+return false otherwise due to internal allocation failures.
+.Sh SEE ALSO
+.Xr ck_array_init 3 ,
+.Xr ck_array_commit 3 ,
+.Xr ck_array_put_unique 3 ,
+.Xr ck_array_remove 3 ,
+.Xr ck_array_deinit 3
+.Xr ck_array_length 3 ,
+.Xr ck_array_buffer 3 ,
+.Xr ck_array_initialized 3 ,
+.Xr CK_ARRAY_FOREACH 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_array_put_unique b/doc/ck_array_put_unique
new file mode 100644
index 000000000000..bb355febce7e
--- /dev/null
+++ b/doc/ck_array_put_unique
@@ -0,0 +1,67 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd October 18, 2013
+.Dt CK_ARRAY_PUT_UNIQUE 3
+.Sh NAME
+.Nm ck_array_put_unique
+.Nd attempt immediate or deferred insertion of a unique pointer into array
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_array.h
+.Ft int
+.Fn ck_array_put_unique "ck_array_t *array" "void *pointer"
+.Sh DESCRIPTION
+The
+.Fn ck_array_put_unique 3
+function will attempt to insert the value of
+.Fa pointer
+into the array pointed to by
+.Fa array .
+This function may incur additional memory allocations
+if not enough memory has been allocated in the array
+for a new entry. The operation is also free to apply
+the operation immediately if there is an opportunity
+for elimination with a pending (uncommitted) remove
+operation. The function will not make any modifications
+if the pointer already exists in the array.
+.Sh RETURN VALUES
+This function returns 1 if the pointer already exists in the array.
+It returns 0 if the put operation succeeded. It returns -1 on
+error due to internal memory allocation failures.
+.Sh SEE ALSO
+.Xr ck_array_init 3 ,
+.Xr ck_array_commit 3 ,
+.Xr ck_array_put 3 ,
+.Xr ck_array_remove 3 ,
+.Xr ck_array_deinit 3
+.Xr ck_array_length 3 ,
+.Xr ck_array_buffer 3 ,
+.Xr ck_array_initialized 3 ,
+.Xr CK_ARRAY_FOREACH 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_array_remove b/doc/ck_array_remove
new file mode 100644
index 000000000000..8df454d8f1d5
--- /dev/null
+++ b/doc/ck_array_remove
@@ -0,0 +1,64 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd October 18, 2013
+.Dt CK_ARRAY_REMOVE 3
+.Sh NAME
+.Nm ck_array_remove
+.Nd attempt immediate or deferred removal of a pointer from an array
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_array.h
+.Ft bool
+.Fn ck_array_remove "ck_array_t *array" "void *pointer"
+.Sh DESCRIPTION
+The
+.Fn ck_array_remove 3
+function will attempt to remove the value of
+.Fa pointer
+into the array pointed to by
+.Fa array . The operation is also free to apply
+the operation immediately if there is an opportunity
+for elimination with a pending (uncommitted) put
+operation. If no elimination was possible, the function
+may require to allocate more memory.
+.Sh RETURN VALUES
+This function returns true if the remove operation succeeded. It will
+return false otherwise due to internal allocation failures or because
+the value did not exist.
+.Sh SEE ALSO
+.Xr ck_array_init 3 ,
+.Xr ck_array_commit 3 ,
+.Xr ck_array_remove 3 ,
+.Xr ck_array_put_unique 3 ,
+.Xr ck_array_deinit 3
+.Xr ck_array_length 3 ,
+.Xr ck_array_buffer 3 ,
+.Xr ck_array_initialized 3 ,
+.Xr CK_ARRAY_FOREACH 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_bitmap_base b/doc/ck_bitmap_base
new file mode 100644
index 000000000000..e9342bfa375c
--- /dev/null
+++ b/doc/ck_bitmap_base
@@ -0,0 +1,58 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd April 22, 2012
+.Dt CK_BITMAP_BASE 3
+.Sh NAME
+.Nm ck_bitmap_base
+.Nd determine the size of a bit array in bytes
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_bitmap.h
+.Ft unsigned int
+.Fn ck_bitmap_base "unsigned int n_bits"
+.Sh DESCRIPTION
+The
+.Fn ck_bitmap_base
+function returns the number of bytes that would be used
+to store the number of bits specified by
+.Fa n_bits .
+.Sh RETURN VALUES
+This function returns a non-zero value that is guaranteed to
+be a multiple of
+.Dv sizeof(CK_BITMAP_WORD) .
+.Sh SEE ALSO
+.Xr ck_bitmap_size 3 ,
+.Xr ck_bitmap_init 3 ,
+.Xr ck_bitmap_set 3 ,
+.Xr ck_bitmap_reset 3 ,
+.Xr ck_bitmap_test 3 ,
+.Xr ck_bitmap_clear 3 ,
+.Xr ck_bitmap_bits 3 ,
+.Xr ck_bitmap_buffer 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_bitmap_bits b/doc/ck_bitmap_bits
new file mode 100644
index 000000000000..efd5eb2ea33d
--- /dev/null
+++ b/doc/ck_bitmap_bits
@@ -0,0 +1,56 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd April 22, 2012
+.Dt CK_BITMAP_BITS 3
+.Sh NAME
+.Nm ck_bitmap_bits
+.Nd return number of addressable bits in bitmap
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_bitmap.h
+.Ft unsigned int
+.Fn ck_bitmap_bits "ck_bitmap_t *bitmap"
+.Sh DESCRIPTION
+The
+.Fn ck_bitmap_bits
+function returns the maximum number of addressable bits in
+the object pointed to by
+.Fa bitmap .
+.Sh RETURN VALUES
+This function returns a non-zero value.
+.Sh SEE ALSO
+.Xr ck_bitmap_base 3 ,
+.Xr ck_bitmap_size 3 ,
+.Xr ck_bitmap_init 3 ,
+.Xr ck_bitmap_set 3 ,
+.Xr ck_bitmap_reset 3 ,
+.Xr ck_bitmap_test 3 ,
+.Xr ck_bitmap_clear 3 ,
+.Xr ck_bitmap_buffer 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_bitmap_bts b/doc/ck_bitmap_bts
new file mode 100644
index 000000000000..872284c16c51
--- /dev/null
+++ b/doc/ck_bitmap_bts
@@ -0,0 +1,61 @@
+.\"
+.\" Copyright 2014 David Joseph.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd August 22, 2014
+.Dt CK_BITMAP_BTS 3
+.Sh NAME
+.Nm ck_bitmap_bts
+.Nd set the bit at the specified index and fetch its original value
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_bitmap.h
+.Ft bool
+.Fn ck_bitmap_bts "ck_bitmap_t *bitmap" "unsigned int n"
+.Sh DESCRIPTION
+.Fn ck_bitmap_bts
+sets the bit at the offset specified by the argument
+.Fa n
+to
+.Dv 1
+and fetches its original value.
+.Sh RETURN VALUES
+This function returns the original value of the bit at offset
+.Fa n
+in
+.Fa bitmap .
+.Sh SEE ALSO
+.Xr ck_bitmap_base 3 ,
+.Xr ck_bitmap_size 3 ,
+.Xr ck_bitmap_init 3 ,
+.Xr ck_bitmap_reset 3 ,
+.Xr ck_bitmap_clear 3 ,
+.Xr ck_bitmap_set 3 ,
+.Xr ck_bitmap_test 3 ,
+.Xr ck_bitmap_bits 3 ,
+.Xr ck_bitmap_buffer 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_bitmap_buffer b/doc/ck_bitmap_buffer
new file mode 100644
index 000000000000..206df0338df1
--- /dev/null
+++ b/doc/ck_bitmap_buffer
@@ -0,0 +1,65 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd April 22, 2012
+.Dt CK_BITMAP_BUFFER 3
+.Sh NAME
+.Nm ck_bitmap_buffer
+.Nd returns pointer to bit array
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_bitmap.h
+.Ft void *
+.Fn ck_bitmap_buffer "ck_bitmap_t *bitmap"
+.Sh DESCRIPTION
+The
+.Fn ck_bitmap_buffer
+functions returns a pointer to the actual bit array.
+For ck_bitmap pointers, the bit array is of type
+CK_BITMAP_WORD[] and consists of
+ck_bitmap_base(bitmap) / sizeof(CK_BITMAP_WORD) elements.
+On currently supported 64-bit platforms
+.Dv CK_BITMAP_WORD
+is
+.Dv uint64_t .
+On currently supported 32-bit platforms
+.Dv CK_BITMAP_WORD
+is
+.Dv uint32_t .
+.Sh RETURN VALUES
+This function returns a non-NULL value.
+.Sh SEE ALSO
+.Xr ck_bitmap_base 3 ,
+.Xr ck_bitmap_size 3 ,
+.Xr ck_bitmap_init 3 ,
+.Xr ck_bitmap_set 3 ,
+.Xr ck_bitmap_reset 3 ,
+.Xr ck_bitmap_test 3 ,
+.Xr ck_bitmap_clear 3 ,
+.Xr ck_bitmap_bits 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_bitmap_clear b/doc/ck_bitmap_clear
new file mode 100644
index 000000000000..f94dca22cd6a
--- /dev/null
+++ b/doc/ck_bitmap_clear
@@ -0,0 +1,56 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd April 22, 2012
+.Dt CK_BITMAP_CLEAR 3
+.Sh NAME
+.Nm ck_bitmap_clear
+.Nd reset all bits
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_bitmap.h
+.Ft void
+.Fn ck_bitmap_clear "ck_bitmap_t *bitmap"
+.Sh DESCRIPTION
+The
+.Fn ck_bitmap_clear
+function sets all bits in the bitmap pointed to by
+.Fa bitmap
+to 0.
+.Sh RETURN VALUES
+This function has no return value.
+.Sh SEE ALSO
+.Xr ck_bitmap_base 3 ,
+.Xr ck_bitmap_size 3 ,
+.Xr ck_bitmap_init 3 ,
+.Xr ck_bitmap_set 3 ,
+.Xr ck_bitmap_reset 3 ,
+.Xr ck_bitmap_test 3 ,
+.Xr ck_bitmap_bits 3 ,
+.Xr ck_bitmap_buffer 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_bitmap_init b/doc/ck_bitmap_init
new file mode 100644
index 000000000000..a238374862a0
--- /dev/null
+++ b/doc/ck_bitmap_init
@@ -0,0 +1,84 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd April 22, 2012
+.Dt CK_BITMAP_INIT 3
+.Sh NAME
+.Nm ck_bitmap_init
+.Nd initialize a bitmap
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_bitmap.h
+.Ft void
+.Fn ck_bitmap_init "ck_bitmap_t *bitmap" "unsigned int n_bits" "bool set"
+.Sh DESCRIPTION
+The
+.Fn ck_bitmap_init
+function initializes the bitmap pointed to by the
+.Fa bitmap
+pointer. The argument
+.Fa n_bits
+specifies the number of bits that are to be stored in the bitmap.
+The argument
+.Fa set
+determines whether the values of the bits in
+.Fa bitmap
+are to be initialized to
+.Dv 1
+or
+.Dv 0 .
+.Pp
+It is expected that
+.Fa bitmap
+points to a contiguous region of memory containing at least
+the number of bytes specified by
+.Xr ck_bitmap_size 3 .
+.Sh RETURN VALUES
+This function has no return value.
+.Sh ERRORS
+.Bl -tag -width Er
+.Pp
+The behavior of
+.Fn ck_bitmap_init
+is undefined if
+.Fa bitmap
+is not a pointer to a region of bytes
+of at least
+.Xr ck_bitmap_size 3
+length.
+.El
+.Sh SEE ALSO
+.Xr ck_bitmap_base 3 ,
+.Xr ck_bitmap_size 3 ,
+.Xr ck_bitmap_set 3 ,
+.Xr ck_bitmap_reset 3 ,
+.Xr ck_bitmap_clear 3 ,
+.Xr ck_bitmap_test 3 ,
+.Xr ck_bitmap_bits 3 ,
+.Xr ck_bitmap_buffer 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_bitmap_iterator_init b/doc/ck_bitmap_iterator_init
new file mode 100644
index 000000000000..d67c6595ed77
--- /dev/null
+++ b/doc/ck_bitmap_iterator_init
@@ -0,0 +1,70 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" Copyright 2012-2013 Shreyas Prasad.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd April 27, 2012
+.Dt CK_BITMAP_ITERATOR_INIT 3
+.Sh NAME
+.Nm ck_bitmap_iterator_init
+.Nd initialize bitmap iterator
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_ht.h
+.Pp
+.Ft void
+.Fn ck_bitmap_iterator_init "ck_bitmap_iterator_t *iterator" "ck_bitmap_t *bitmap"
+.Sh DESCRIPTION
+The
+.Fn ck_bitmap_iterator_init
+function will initialize the object pointed to by
+the
+.Fa iterator
+argument for use with
+.Fa bitmap .
+.Pp
+An iterator is used to iterate through set bitmap bits
+with the
+.Xr ck_bitmap_next 3
+function.
+.Sh RETURN VALUES
+The
+.Fn ck_bitmap_iterator_init
+function does not return a value.
+.Sh ERRORS
+This function will not fail.
+.Sh SEE ALSO
+.Xr ck_bitmap_base 3 ,
+.Xr ck_bitmap_size 3 ,
+.Xr ck_bitmap_init 3 ,
+.Xr ck_bitmap_set 3 ,
+.Xr ck_bitmap_reset 3 ,
+.Xr ck_bitmap_clear 3 ,
+.Xr ck_bitmap_bits 3 ,
+.Xr ck_bitmap_buffer 3 ,
+.Xr ck_bitmap_next 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_bitmap_next b/doc/ck_bitmap_next
new file mode 100644
index 000000000000..3e93c4326652
--- /dev/null
+++ b/doc/ck_bitmap_next
@@ -0,0 +1,90 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" Copyright 2012-2013 Shreyas Prasad.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd April 27, 2012
+.Dt CK_BITMAP_TEST 3
+.Sh NAME
+.Nm ck_bitmap_next
+.Nd iterate to the next set bit in bitmap
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_bitmap.h
+.Ft bool
+.Fn ck_bitmap_next "ck_bitmap_t *bitmap" "ck_bitmap_iterator_t iterator" "unsigned int *bit"
+.Sh DESCRIPTION
+The
+.Fn ck_bitmap_next
+function will increment the iterator object pointed to by
+.Fa iterator
+to point to the next set bit in the bitmap. If
+.Fn ck_bitmap_next
+returns
+.Dv true
+then the pointer pointed to by
+.Fa bit
+is initialized to the number of the current set bit pointed to by the
+.Fa iterator
+object.
+.Pp
+It is expected that
+.Fa iterator
+has been initialized using the
+.Xr ck_bitmap_iterator_init 3
+function.
+.Sh RETURN VALUES
+If
+.Fn ck_bitmap_next
+returns
+.Dv true
+then the object pointed to by
+.Fa bit
+contains a set bit. If
+.Fn ck_bitmap_next
+returns
+.Dv false
+then value of the object pointed to by
+.Fa bit
+is undefined.
+.Sh ERRORS
+Behavior is undefined if
+.Fa iterator
+or
+.Fa bitmap
+are uninitialized.
+.Sh SEE ALSO
+.Xr ck_bitmap_base 3 ,
+.Xr ck_bitmap_size 3 ,
+.Xr ck_bitmap_init 3 ,
+.Xr ck_bitmap_set 3 ,
+.Xr ck_bitmap_reset 3 ,
+.Xr ck_bitmap_clear 3 ,
+.Xr ck_bitmap_bits 3 ,
+.Xr ck_bitmap_buffer 3 ,
+.Xr ck_bitmap_iterator_init 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_bitmap_reset b/doc/ck_bitmap_reset
new file mode 100644
index 000000000000..c6b8ee531a33
--- /dev/null
+++ b/doc/ck_bitmap_reset
@@ -0,0 +1,57 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd April 22, 2012
+.Dt CK_BITMAP_RESET 3
+.Sh NAME
+.Nm ck_bitmap_reset
+.Nd resets the bit at the specified index
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_bitmap.h
+.Ft void
+.Fn ck_bitmap_reset "ck_bitmap_t *bitmap" "unsigned int n"
+.Sh DESCRIPTION
+The
+.Fn ck_bitmap_reset
+resets the bit at offset specified by the argument
+.Fa n
+to
+.Dv 0 .
+.Sh RETURN VALUES
+This function has no return value.
+.Sh SEE ALSO
+.Xr ck_bitmap_base 3 ,
+.Xr ck_bitmap_size 3 ,
+.Xr ck_bitmap_init 3 ,
+.Xr ck_bitmap_set 3 ,
+.Xr ck_bitmap_clear 3 ,
+.Xr ck_bitmap_test 3 ,
+.Xr ck_bitmap_bits 3 ,
+.Xr ck_bitmap_buffer 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_bitmap_set b/doc/ck_bitmap_set
new file mode 100644
index 000000000000..e92ba243f83b
--- /dev/null
+++ b/doc/ck_bitmap_set
@@ -0,0 +1,57 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd April 22, 2012
+.Dt CK_BITMAP_SET 3
+.Sh NAME
+.Nm ck_bitmap_set
+.Nd set the bit at the specified index
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_bitmap.h
+.Ft void
+.Fn ck_bitmap_set "ck_bitmap_t *bitmap" "unsigned int n"
+.Sh DESCRIPTION
+The
+.Fn ck_bitmap_set
+sets the bit at offset specified by the argument
+.Fa n
+to
+.Dv 1 .
+.Sh RETURN VALUES
+This function has no return value.
+.Sh SEE ALSO
+.Xr ck_bitmap_base 3 ,
+.Xr ck_bitmap_size 3 ,
+.Xr ck_bitmap_init 3 ,
+.Xr ck_bitmap_reset 3 ,
+.Xr ck_bitmap_clear 3 ,
+.Xr ck_bitmap_test 3 ,
+.Xr ck_bitmap_bits 3 ,
+.Xr ck_bitmap_buffer 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_bitmap_size b/doc/ck_bitmap_size
new file mode 100644
index 000000000000..03e5892fb7f7
--- /dev/null
+++ b/doc/ck_bitmap_size
@@ -0,0 +1,62 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd April 22, 2012
+.Dt CK_BITMAP_SIZE 3
+.Sh NAME
+.Nm ck_bitmap_size
+.Nd returns necessary number of bytes for bitmap
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_bitmap.h
+.Ft unsigned int
+.Fn ck_bitmap_size "unsigned int n_bits"
+.Sh DESCRIPTION
+The
+.Fn ck_bitmap_size
+function returns the number of bytes that are necessary
+to allocate for a bitmap that will contain the number
+of bits specified by
+.Fa n_bits .
+.Pp
+This function is used to determine how many bytes to
+allocate for dynamically created bitmap objects. The
+allocated object must still be initialized using
+.Xr ck_bitmap_init 3 .
+.Sh RETURN VALUES
+This function returns a non-zero value.
+.Sh SEE ALSO
+.Xr ck_bitmap_base 3 ,
+.Xr ck_bitmap_init 3 ,
+.Xr ck_bitmap_set_mpmc 3 ,
+.Xr ck_bitmap_reset_mpmc 3 ,
+.Xr ck_bitmap_test 3 ,
+.Xr ck_bitmap_clear 3 ,
+.Xr ck_bitmap_bits 3 ,
+.Xr ck_bitmap_buffer 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_bitmap_test b/doc/ck_bitmap_test
new file mode 100644
index 000000000000..9eb8936dac22
--- /dev/null
+++ b/doc/ck_bitmap_test
@@ -0,0 +1,62 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd April 22, 2012
+.Dt CK_BITMAP_TEST 3
+.Sh NAME
+.Nm ck_bitmap_test
+.Nd determine if the bit at the specified index is set
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_bitmap.h
+.Ft bool
+.Fn ck_bitmap_test "ck_bitmap_t *bitmap" "unsigned int n"
+.Sh DESCRIPTION
+The
+.Fn ck_bitmap_test
+determines if the bit at the offset specified by the argument
+.Fa n
+is set to
+.Dv 1 .
+.Sh RETURN VALUES
+This function returns
+.Dv true
+if the bit at the specified offset is set to
+.Dv 1
+and otherwise returns
+.Dv false .
+.Sh SEE ALSO
+.Xr ck_bitmap_base 3 ,
+.Xr ck_bitmap_size 3 ,
+.Xr ck_bitmap_init 3 ,
+.Xr ck_bitmap_set_mpmc 3 ,
+.Xr ck_bitmap_reset_mpmc 3 ,
+.Xr ck_bitmap_clear 3 ,
+.Xr ck_bitmap_bits 3 ,
+.Xr ck_bitmap_buffer 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_bitmap_union b/doc/ck_bitmap_union
new file mode 100644
index 000000000000..b0ab8e8f7e3b
--- /dev/null
+++ b/doc/ck_bitmap_union
@@ -0,0 +1,58 @@
+.\"
+.\" Copyright 2012-2014 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd February 23, 2013
+.Dt CK_BITMAP_UNION 3
+.Sh NAME
+.Nm ck_bitmap_union
+.Nd generates union of two bitmaps
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_bitmap.h
+.Ft void
+.Fn ck_bitmap_union "ck_bitmap_t *dst" "ck_bitmap_t *src"
+.Sh DESCRIPTION
+The
+.Fn ck_bitmap_union
+function sets all bits in the bitmap pointed to by
+.Fa src
+in the bitmap pointed to by
+.Fa dst .
+.Sh RETURN VALUES
+This function has no return value.
+.Sh SEE ALSO
+.Xr ck_bitmap_base 3 ,
+.Xr ck_bitmap_size 3 ,
+.Xr ck_bitmap_init 3 ,
+.Xr ck_bitmap_reset 3 ,
+.Xr ck_bitmap_set 3 ,
+.Xr ck_bitmap_clear 3 ,
+.Xr ck_bitmap_test 3 ,
+.Xr ck_bitmap_bits 3 ,
+.Xr ck_bitmap_buffer 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_brlock b/doc/ck_brlock
new file mode 100644
index 000000000000..7972ee43ef65
--- /dev/null
+++ b/doc/ck_brlock
@@ -0,0 +1,121 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd July 26, 2013.
+.Dt ck_brlock 3
+.Sh NAME
+.Nm ck_brlock_init ,
+.Nm ck_brlock_write_lock ,
+.Nm ck_brlock_write_unlock ,
+.Nm ck_brlock_write_trylock ,
+.Nm ck_brlock_read_register ,
+.Nm ck_brlock_read_unregister ,
+.Nm ck_brlock_read_lock ,
+.Nm ck_brlock_read_trylock ,
+.Nm ck_brlock_read_unlock
+.Nd big-reader locks
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_brlock.h
+.Pp
+.Dv ck_brlock_t brlock = CK_BRLOCK_INITIALIZER;
+.Pp
+.Dv ck_brlock_reader_t reader = CK_BRLOCK_READER_INITIALIZER;
+.Pp
+.Ft void
+.Fn ck_brlock_init "ck_brlock_t *br"
+.Ft void
+.Fn ck_brlock_write_lock "ck_brlock_t *br"
+.Ft void
+.Fn ck_brlock_write_unlock "ck_brlock_t *br"
+.Ft bool
+.Fn ck_brlock_write_trylock "ck_brlock_t *br" "unsigned int factor"
+.Ft void
+.Fn ck_brlock_read_register "ck_brlock_t *br" "ck_brlock_reader_t *reader"
+.Ft void
+.Fn ck_brlock_read_unregister "ck_brlock_t *br" "ck_brlock_reader_t *reader"
+.Ft void
+.Fn ck_brlock_read_lock "ck_brlock_t *br" "ck_brlock_reader_t *reader"
+.Ft bool
+.Fn ck_brlock_read_trylock "ck_brlock_t *br" "ck_brlock_reader_t *reader" \
+"unsigned int factor"
+.Ft void
+.Fn ck_brlock_read_unlock "ck_brlock_reader_t *reader"
+.Sh DESCRIPTION
+Big reader locks are distributed reader-writer locks with low latency constant time
+reader acquisition (with respect to number of concurrent readers). On the other
+hand, writer acquisitions are a relatively expensive O(n) operation. This is a write-biased
+lock.
+.Sh EXAMPLE
+.Bd -literal -offset indent
+static ck_brlock_t lock = CK_BRLOCK_INITIALIZER;
+static __thread ck_brlock_reader_t reader;
+
+static void
+reader(void)
+{
+
+ /* Add our thread as a lock participant. */
+ ck_brlock_read_register(&lock, &reader);
+
+ for (;;) {
+ ck_brlock_read_lock(&lock, &reader);
+ /* Read-side critical section. */
+ ck_brlock_read_unlock(&reader);
+
+ if (ck_brlock_read_trylock(&lock, &reader, 1) == true) {
+ /* Read-side critical section. */
+ ck_brlock_read_unlock(&reader);
+ }
+ }
+
+ return;
+}
+
+static void
+writer(void)
+{
+
+ for (;;) {
+ ck_brlock_write_lock(&lock);
+ /* Write-side critical section. */
+ ck_brlock_write_unlock(&lock);
+
+ if (ck_brlock_write_trylock(&lock, 1) == true) {
+ /* Write-side critical section. */
+ ck_brlock_write_unlock(&lock);
+ }
+ }
+
+ return;
+}
+.Ed
+.Sh SEE ALSO
+.Xr ck_bytelock 3 ,
+.Xr ck_rwlock 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_cohort b/doc/ck_cohort
new file mode 100644
index 000000000000..490541848db0
--- /dev/null
+++ b/doc/ck_cohort
@@ -0,0 +1,211 @@
+.\"
+.\" Copyright 2013 Brendon Scheinman.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd February 24, 2013.
+.Dt ck_cohort 3
+.Sh NAME
+.Nm ck_cohort
+.Nd generalized interface for lock cohorts
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_cohort.h
+.Fn CK_COHORT_PROTOTYPE "COHORT_NAME cohort_name" "LOCK_FXN global_lock_method" \
+"LOCK_FXN global_unlock_method" "LOCK_FXN local_lock_method" "LOCK_FXN local_unlock_method"
+.Fn CK_COHORT_TRYLOCK_PROTOTYPE "COHORT_NAME cohort_name" \
+"LOCK_FXN global_lock_method" "LOCK_FXN global_unlock_method" \
+"BOOL_LOCK_FXN global_locked_method" "BOOL_LOCK_FXN global_trylock_method" \
+"LOCK_FXN local_lock_method" "LOCK_FXN local_unlock_method" \
+"BOOL_LOCK_FXN local_locked_method" "BOOL_LOCK_FXN local_trylock_method"
+.Fn CK_COHORT_INSTANCE "COHORT_NAME cohort_name"
+.Fn CK_COHORT_INIT "COHORT_NAME cohort_name" "ck_cohort *cohort" \
+"void *global_lock" "void *local_lock" "unsigned int pass_limit"
+.Fn CK_COHORT_LOCK "COHORT_NAME cohort_name" "ck_cohort *cohort" \
+"void *global_context" "void *local_context"
+.Fn CK_COHORT_UNLOCK "COHORT_NAME cohort_name" "ck_cohort *cohort" \
+"void *global_context" "void *local_context"
+.Pp
+Where LOCK_FXN refers to a method with the signature
+.br
+void(void *lock, void *context)
+.br
+BOOL_LOCK_FXN refers to a method with the signature
+.br
+bool(void *lock, void *context)
+.Pp
+The
+.Fa context
+argument in each signature is used to pass along any additional information that
+the lock might need for its lock, unlock and trylock methods. The values for this
+argument are provided to each call to
+.Xr CK_COHORT_LOCK 3 ,
+.Xr CK_COHORT_UNLOCK 3 ,
+.Xr CK_COHORT_LOCKED 3 ,
+and
+.Xr CK_COHORT_TRYLOCK 3
+.
+.Sh DESCRIPTION
+ck_cohort.h provides an interface for defining lock cohorts with
+arbitrary lock types. Cohorts are a mechanism for coordinating
+threads on NUMA architectures in order to reduce the frequency
+with which a lock is passed between threads on different clusters.
+.Pp
+Before using a cohort, the user must define a cohort type using
+either the
+.Fn CK_COHORT_PROTOTYPE
+or the
+.Fn CK_COHORT_TRYLOCK_PROTOTYPE
+macros. These macros allow the user to specify the lock methods that
+they would like the cohort to use. See the
+.Xr CK_COHORT_PROTOTYPE 3
+and
+.Xr CK_COHORT_TRYLOCK_PROTOTYPE 3
+man pages for more details.
+.Pp
+.Sh EXAMPLE
+.Bd -literal -offset indent
+#include <stdlib.h>
+#include <pthread.h>
+
+#include <ck_pr.h>
+#include <ck_cohort.h>
+#include <ck_spinlock.h>
+
+/*
+ * Create cohort methods with signatures that match
+ * the required signature
+ */
+static void
+ck_spinlock_lock_with_context(ck_spinlock_t *lock, void *context)
+{
+ (void)context;
+ ck_spinlock_lock(lock);
+ return;
+}
+
+static void
+ck_spinlock_unlock_with_context(ck_spinlock_t *lock, void *context)
+{
+ (void)context;
+ ck_spinlock_unlock(lock);
+ return;
+}
+
+static bool
+ck_spinlock_locked_with_context(ck_spinlock_t *lock, void *context)
+{
+ (void)context;
+ return ck_spinlock_locked(lock);
+}
+
+/*
+ * define a cohort type named "test_cohort" that will use
+ * the above methods for both its global and local locks
+ */
+CK_COHORT_PROTOTYPE(test_cohort,
+ ck_spinlock_lock_with_context, ck_spinlock_unlock_with_context, ck_spinlock_locked_with_context,
+ ck_spinlock_lock_with_context, ck_spinlock_unlock_with_context, ck_spinlock_locked_with_context)
+
+static ck_spinlock_t global_lock = CK_SPINLOCK_INITIALIZER;
+static unsigned int ready;
+
+static void *
+function(void *context)
+{
+ CK_COHORT_INSTANCE(test_cohort) *cohort = context;
+
+ while (ready == 0);
+
+ while (ready > 0) {
+ /*
+ * acquire the cohort lock before performing critical section.
+ * note that we pass NULL for both the global and local context
+ * arguments because neither the lock nor unlock functions
+ * will use them.
+ */
+ CK_COHORT_LOCK(test_cohort, cohort, NULL, NULL);
+
+ /* perform critical section */
+
+ /* relinquish cohort lock */
+ CK_COHORT_UNLOCK(test_cohort, cohort, NULL, NULL);
+ }
+
+ return NULL;
+}
+
+int
+main(void)
+{
+ unsigned int nthr = 4;
+ unsigned int n_cohorts = 2;
+ unsigned int i;
+
+ /* allocate 2 cohorts of the defined type */
+ CK_COHORT_INSTANCE(test_cohort) *cohorts =
+ calloc(n_cohorts, sizeof(CK_COHORT_INSTANCE(test_cohort)));
+
+ /* create local locks to use with each cohort */
+ ck_spinlock_t *local_locks =
+ calloc(n_cohorts, sizeof(ck_spinlock_t));
+
+ pthread_t *threads =
+ calloc(nthr, sizeof(pthread_t));
+
+ /* initialize each of the cohorts before using them */
+ for (i = 0 ; i < n_cohorts ; ++i) {
+ CK_COHORT_INIT(test_cohort, cohorts + i, &global_lock, local_locks + i,
+ CK_COHORT_DEFAULT_LOCAL_PASS_LIMIT);
+ }
+
+ /* start each thread and assign cohorts equally */
+ for (i = 0 ; i < nthr ; ++i) {
+ pthread_create(threads + i, NULL, function, cohorts + (i % n_cohorts));
+ }
+
+ ck_pr_store_uint(&ready, 1);
+ sleep(10);
+ ck_pr_store_uint(&ready, 0);
+
+ for (i = 0 ; i < nthr ; ++i) {
+ pthread_join(threads[i], NULL);
+ }
+
+ return 0;
+}
+.Ed
+.Sh SEE ALSO
+.Xr CK_COHORT_PROTOTYPE 3 ,
+.Xr CK_COHORT_TRYLOCK_PROTOTYPE 3 ,
+.Xr CK_COHORT_INSTANCE 3 ,
+.Xr CK_COHORT_INITIALIZER 3 ,
+.Xr CK_COHORT_INIT 3 ,
+.Xr CK_COHORT_LOCK 3 ,
+.Xr CK_COHORT_UNLOCK 3 ,
+.Xr CK_COHORT_LOCKED 3 ,
+.Xr CK_COHORT_TRYLOCK 3 ,
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_elide b/doc/ck_elide
new file mode 100644
index 000000000000..c0685677a059
--- /dev/null
+++ b/doc/ck_elide
@@ -0,0 +1,252 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd July 13, 2013.
+.Dt ck_elide 3
+.Sh NAME
+.Nm CK_ELIDE_PROTOTYPE ,
+.Nm CK_ELIDE_LOCK_ADAPTIVE ,
+.Nm CK_ELIDE_UNLOCK_ADAPTIVE ,
+.Nm CK_ELIDE_LOCK ,
+.Nm CK_ELIDE_UNLOCK ,
+.Nm CK_ELIDE_TRYLOCK_PROTOTYPE ,
+.Nm CK_ELIDE_TRYLOCK
+.Nd lock elision wrappers
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_elide.h
+.Pp
+.Dv ck_elide_stat_t stat = CK_ELIDE_STAT_INITIALIZER;
+.Pp
+.Ft void
+.Fn ck_elide_stat_init "ck_elide_stat_t *"
+.Pp
+.Dv struct ck_elide_config config = CK_ELIDE_CONFIG_DEFAULT_INITIALIZER;
+.Pp
+.Bd -literal -offset
+struct ck_elide_config {
+ unsigned short skip_busy;
+ short retry_busy;
+ unsigned short skip_other;
+ short retry_other;
+ unsigned short skip_conflict;
+ short retry_conflict;
+};
+.Ed
+.Pp
+.Fn CK_ELIDE_PROTOTYPE "NAME" "TYPE" "LOCK_PREDICATE" "LOCK_FUNCTION" "UNLOCK_PREDICATE" "UNLOCK_FUNCTION"
+.Fn CK_ELIDE_LOCK_ADAPTIVE "NAME" "ck_elide_stat_t *" "struct ck_elide_config *" "TYPE *"
+.Fn CK_ELIDE_UNLOCK_ADAPTIVE "NAME" "ck_elide_stat_t *" "TYPE *"
+.Fn CK_ELIDE_LOCK "NAME" "TYPE *"
+.Fn CK_ELIDE_UNLOCK "NAME" "TYPE *"
+.Fn CK_ELIDE_TRYLOCK_PROTOTYPE "NAME" "TYPE" "LOCK_PREDICATE" "TRYLOCK_FUNCTION"
+.Sh DESCRIPTION
+These macros implement lock elision wrappers for a user-specified single-argument
+lock interface. The wrappers will attempt to elide lock acquisition, allowing
+concurrent execution of critical sections that do not issue conflicting memory
+operations. If any threads have successfully elided a lock acquisition,
+conflicting memory operations will roll-back any side-effects of the critical
+section and force every thread to retry the lock acquisition regularly.
+.Pp
+.Fn CK_ELIDE_LOCK ,
+.Fn CK_ELIDE_UNLOCK ,
+.Fn CK_ELIDE_LOCK_ADAPTIVE ,
+and
+.Fn CK_ELIDE_UNLOCK_ADAPTIVE
+macros require
+a previous
+.Fn CK_ELIDE_PROTOTYPE
+with the same
+.Fa NAME .
+Elision is attempted if the
+.Fa LOCK_PREDICATE
+function returns false. If
+.Fa LOCK_PREDICATE
+returns true then elision is aborted and
+.Fa LOCK_FUNCTION
+is executed instead. If any threads are in an elided critical section,
+.Fa LOCK_FUNCTION
+must force them to rollback through a conflicting memory operation.
+The
+.Fa UNLOCK_PREDICATE
+function must return true if the lock is acquired by the caller, meaning
+that the lock was not successfully elided. If
+.Fa UNLOCK_PREDICATE
+returns true, then the
+.Fa UNLOCK_FUNCTION
+is executed. If RTM is unsupported (no CK_F_PR_RTM macro) then
+.Fn CK_ELIDE_LOCK
+and
+.Fn CK_ELIDE_LOCK_ADAPTIVE
+will immediately call
+.Fn LOCK_FUNCTION .
+.Fn CK_ELIDE_UNLOCK
+and
+.Fn CK_ELIDE_UNLOCK_ADAPTIVE
+will immediately call
+.Fn UNLOCK_FUNCTION .
+.Pp
+.Fn CK_ELIDE_TRYLOCK
+requires a previous
+.Fn CK_ELIDE_TRYLOCK_PROTOTYPE
+with the same name.
+Elision is attempted if the
+.Fa LOCK_PREDICATE
+function returns false. If
+.Fa LOCK_PREDICATE
+returns true or if elision fails then the
+operation is aborted. If RTM is unsupported
+(no CK_F_PR_RTM macro) then
+.Fn CK_ELIDE_TRYLOCK
+will immediately call
+.Fn TRYLOCK_FUNCTION .
+.Pp
+.Fn CK_ELIDE_LOCK_ADAPTIVE
+and
+.Fn CK_ELIDE_UNLOCK_ADAPTIVE
+will adapt the elision behavior associated with lock operations
+according to the run-time behavior of the program. This behavior
+is defined by the ck_elide_config structure pointer passed to
+.Fn CK_ELIDE_LOCK_ADAPTIVE .
+A thread-local ck_elide_stat structure must be passed to both
+.Fn CK_ELIDE_LOCK_ADAPTIVE
+and
+.Fn CK_ELIDE_UNLOCK_ADAPTIVE .
+This structure is expected to be unique for different workloads,
+may not be re-used in recursive acquisitions and must match the
+lifetime of the lock it is associated with. It is safe to mix
+adaptive calls with best-effort calls.
+.Pp
+Both ck_spinlock.h and ck_rwlock.h define ck_elide wrappers under
+the ck_spinlock and ck_rwlock namespace, respectively.
+.Sh EXAMPLES
+This example utilizes built-in lock elision facilities in ck_rwlock and ck_spinlock.
+.Bd -literal -offset indent
+#include <ck_rwlock.h>
+#include <ck_spinlock.h>
+
+static ck_rwlock_t rw = CK_RWLOCK_INITIALIZER;
+static struct ck_elide_config rw_config =
+ CK_ELIDE_CONFIG_DEFAULT_INITIALIZER;
+static __thread ck_elide_stat_t rw_stat =
+ CK_ELIDE_STAT_INITIALIZER;
+
+static ck_spinlock_t spinlock = CK_SPINLOCK_INITIALIZER;
+static struct ck_elide_config spinlock_config =
+ CK_ELIDE_CONFIG_DEFAULT_INITIALIZER;
+static __thread ck_elide_stat_t spinlock_stat =
+ CK_ELIDE_STAT_INITIALIZER;
+
+void
+function(void)
+{
+
+ /* Lock-unlock write-side lock in weak best-effort manner. */
+ CK_ELIDE_LOCK(ck_rwlock_write, &rw);
+ CK_ELIDE_UNLOCK(ck_rwlock_write, &rw);
+
+ /* Attempt to acquire the write-side lock. */
+ if (CK_ELIDE_TRYLOCK(ck_rwlock_write, &rw) == true)
+ CK_ELIDE_UNLOCK(ck_rwlock_write, &rw);
+
+ /* Lock-unlock read-side lock in weak best-effort manner. */
+ CK_ELIDE_LOCK(ck_rwlock_read, &rw);
+ CK_ELIDE_UNLOCK(ck_rwlock_read, &rw);
+
+ /* Attempt to acquire the read-side lock. */
+ if (CK_ELIDE_TRYLOCK(ck_rwlock_read, &rw) == true)
+ CK_ELIDE_UNLOCK(ck_rwlock_read, &rw);
+
+ /* Lock-unlock write-side lock in an adaptive manner. */
+ CK_ELIDE_LOCK_ADAPTIVE(ck_rwlock_write, &rw_stat,
+ &rw_config, &rw);
+ CK_ELIDE_UNLOCK_ADAPTIVE(ck_rwlock_write, &rw_stat,
+ &rw_config, &rw);
+
+ /* Lock-unlock read-side lock in an adaptive manner. */
+ CK_ELIDE_LOCK_ADAPTIVE(ck_rwlock_read, &rw_stat,
+ &rw_config, &rw);
+ CK_ELIDE_UNLOCK_ADAPTIVE(ck_rwlock_read, &rw_stat,
+ &rw_config, &rw);
+
+ /* Lock-unlock spinlock in weak best-effort manner. */
+ CK_ELIDE_LOCK(ck_spinlock, &spinlock);
+ CK_ELIDE_UNLOCK(ck_spinlock, &spinlock);
+
+ /* Attempt to acquire the lock. */
+ if (CK_ELIDE_TRYLOCK(ck_spinlock, &lock) == true)
+ CK_ELIDE_UNLOCK(ck_spinlock, &spinlock);
+
+ /* Lock-unlock spinlock in an adaptive manner. */
+ CK_ELIDE_LOCK_ADAPTIVE(ck_spinlock, &spinlock_stat,
+ &spinlock_config, &spinlock);
+ CK_ELIDE_UNLOCK_ADAPTIVE(ck_spinlock, &spinlock_stat,
+ &spinlock_config, &spinlock);
+}
+.Ed
+.Pp
+In this example, user-defined locking functions are provided an elision
+implementation.
+.Bd -literal -offset indent
+/* Assume lock_t has been previously defined. */
+#include <ck_elide.h>
+
+/*
+ * This function returns true if the lock is unavailable at the time
+ * it was called or false if the lock is available.
+ */
+bool is_locked(lock_t *);
+
+/*
+ * This function acquires the supplied lock.
+ */
+void lock(lock_t *);
+
+/*
+ * This function releases the lock.
+ */
+void unlock(lock_t *);
+
+CK_ELIDE_PROTOTYPE(my_lock, lock_t, is_locked, lock, is_locked, unlock)
+
+static lock_t lock;
+
+void
+function(void)
+{
+
+ CK_ELIDE_LOCK(my_lock, &lock);
+ CK_ELIDE_UNLOCK(my_lock, &lock);
+}
+.Ed
+.Sh SEE ALSO
+.Xr ck_rwlock 3 ,
+.Xr ck_spinlock 3
+.Pp
+Ravi Rajwar and James R. Goodman. 2001. Speculative lock elision: enabling highly concurrent multithreaded execution. In Proceedings of the 34th annual ACM/IEEE international symposium on Microarchitecture (MICRO 34). IEEE Computer Society, Washington, DC, USA, 294-305.
+.Pp
+Additional information available at http://en.wikipedia.org/wiki/Transactional_Synchronization_Extensions and http://concurrencykit.org/
diff --git a/doc/ck_epoch_barrier b/doc/ck_epoch_barrier
new file mode 100644
index 000000000000..a5861456831f
--- /dev/null
+++ b/doc/ck_epoch_barrier
@@ -0,0 +1,120 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd September 2, 2012
+.Dt CK_EPOCH_BARRIER 3
+.Sh NAME
+.Nm ck_epoch_barrier
+.Nd block until a grace period and all callbacks have been dispatched
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_epoch.h
+.Ft void
+.Fn ck_epoch_barrier "ck_epoch_record_t *record"
+.Sh DESCRIPTION
+The
+.Fn ck_epoch_barrier 3
+function will block the caller until a grace period has been
+detected, according to the semantics of epoch reclamation.
+Any objects requiring safe memory reclamation which are logically
+deleted are safe for physical deletion following a call to
+.Fn ck_epoch_barrier 3 . This function will also dispatch all callbacks
+associated with
+.Fa epoch
+that were previously scheduled via
+.Fn ck_epoch_call 3 .
+.Sh EXAMPLE
+.Bd -literal -offset indent
+
+#include <ck_epoch.h>
+#include <ck_stack.h>
+#include <stdlib.h>
+
+/*
+ * epoch was previously initialized with ck_epoch_init.
+ * stack was previously initialized with ck_stack_init.
+ */
+ck_epoch_t *epoch;
+ck_stack_t *stack;
+
+void
+function(void)
+{
+ ck_epoch_record_t *record;
+ ck_stack_entry_t *s;
+
+ record = malloc(sizeof *record);
+ ck_epoch_register(&epoch, record);
+
+ /*
+ * We are using an epoch section here to guarantee no
+ * nodes in the stack are deleted while we are dereferencing
+ * them. This is needed here because there are multiple writers.
+ * If there was only one thread popping from the this stack,
+ * then there is no need to ck_epoch_begin/ck_epoch_end.
+ */
+ ck_epoch_begin(record);
+
+ /* Logically delete an object. */
+ s = ck_stack_pop_upmc(stack);
+
+ ck_epoch_end(record);
+
+ /*
+ * Wait until no threads could possibly have a reference to the
+ * object we just popped (assume all threads are simply executing
+ * ck_stack_pop_upmc).
+ */
+ ck_epoch_barrier(record);
+
+ /* It is now safe to physically delete the object. */
+ free(s);
+ return;
+}
+.Ed
+.Sh RETURN VALUES
+This function has no return value.
+.Sh ERRORS
+Behavior is undefined if the object pointed to by
+.Fa epoch
+is not a valid epoch object. The object pointed to by
+.Fa record
+must have been previously registered via
+.Fn ck_epoch_register 3 .
+.Sh SEE ALSO
+.Xr ck_epoch_init 3 ,
+.Xr ck_epoch_register 3 ,
+.Xr ck_epoch_unregister 3 ,
+.Xr ck_epoch_recycle 3 ,
+.Xr ck_epoch_poll 3 ,
+.Xr ck_epoch_synchronize 3 ,
+.Xr ck_epoch_reclaim 3 ,
+.Xr ck_epoch_call 3 ,
+.Xr ck_epoch_begin 3 ,
+.Xr ck_epoch_end 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_epoch_begin b/doc/ck_epoch_begin
new file mode 100644
index 000000000000..a44ecf878991
--- /dev/null
+++ b/doc/ck_epoch_begin
@@ -0,0 +1,73 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd September 2, 2012
+.Dt CK_EPOCH_BEGIN 3
+.Sh NAME
+.Nm ck_epoch_begin
+.Nd begin epoch-protected segment of execution
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_epoch.h
+.Ft void
+.Fn ck_epoch_begin "ck_epoch_record_t *record" "ck_epoch_section_t *section"
+.Sh DESCRIPTION
+The
+.Fn ck_epoch_begin 3
+function will mark the beginning of an epoch-protected code section.
+An epoch-protected code section is delimited by a call to the
+.Fn ck_epoch_end 3
+function. Though recursion is allowed for epoch-protected sections,
+recursive calls will be associated with the
+.Fn ck_epoch_begin 3
+that is at the top of the call stack. If a section is passed, then
+recursion on a record will cause the epoch to be refreshed on entry
+of every protected section.
+.Sh RETURN VALUES
+This function has no return value.
+.Sh ERRORS
+The object pointed to by
+.Fa epoch
+must have been previously initiated via
+.Fn ck_epoch_init 3 .
+The object pointed to by
+.Fa record
+must have been previously registered via
+.Fn ck_epoch_register 3 .
+.Sh SEE ALSO
+.Xr ck_epoch_init 3 ,
+.Xr ck_epoch_register 3 ,
+.Xr ck_epoch_unregister 3 ,
+.Xr ck_epoch_recycle 3 ,
+.Xr ck_epoch_poll 3 ,
+.Xr ck_epoch_synchronize 3 ,
+.Xr ck_epoch_reclaim 3 ,
+.Xr ck_epoch_barrier 3 ,
+.Xr ck_epoch_call 3 ,
+.Xr ck_epoch_end 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_epoch_call b/doc/ck_epoch_call
new file mode 100644
index 000000000000..73906424ffb9
--- /dev/null
+++ b/doc/ck_epoch_call
@@ -0,0 +1,136 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd September 2, 2012
+.Dt CK_EPOCH_CALL 3
+.Sh NAME
+.Nm ck_epoch_call
+.Nd defer function execution until a grace period
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_epoch.h
+typedef struct ck_epoch_entry ck_epoch_entry_t;
+.br
+typedef void ck_epoch_cb_t(ck_epoch_entry_t *);
+.Ft void
+.Fn ck_epoch_call "ck_epoch_record_t *record" "ck_epoch_entry_t *entry" "ck_epoch_cb_t *function"
+.Sh DESCRIPTION
+The
+.Fn ck_epoch_call 3
+function will defer the execution of the function pointed to by
+.Fa function
+until a grace-period has been detected in
+.Fa epoch .
+The function will be provided
+the pointer specified by
+.Fa entry .
+The function will execute at some time in the future via calls to
+.Fn ck_epoch_reclaim 3 ,
+.Fn ck_epoch_barrier 3
+or
+.Fn ck_epoch_poll 3 .
+.Sh EXAMPLE
+.Bd -literal -offset indent
+
+#include <ck_epoch.h>
+#include <ck_stack.h>
+#include <stdlib.h>
+
+/*
+ * epoch was previously initialized with ck_epoch_init.
+ */
+ck_epoch_t *epoch;
+
+struct object {
+ int value;
+ ck_epoch_entry_t epoch_entry;
+};
+static struct object *global;
+
+CK_EPOCH_CONTAINER(struct object, epoch_entry, object_container)
+
+void
+destroy_object(ck_epoch_entry_t *e)
+{
+ struct object *o = object_container(e);
+
+ free(o);
+ return;
+}
+
+void
+function(void)
+{
+ ck_epoch_record_t *record;
+ struct object *n;
+
+ record = malloc(sizeof *record);
+ ck_epoch_register(&epoch, record);
+
+ n = malloc(sizeof *n);
+ if (n == NULL)
+ return;
+
+ n->value = 1;
+
+ /*
+ * We are using an epoch section here because there are multiple
+ * writers. It is also an option to use other forms of blocking
+ * write-side synchronization such as mutexes.
+ */
+ ck_epoch_begin(record);
+ n = ck_pr_fas_ptr(&global, n);
+ ck_epoch_end(record);
+
+ /* Defer destruction of previous object. */
+ ck_epoch_call(record, &n->epoch_entry, destroy_object);
+
+ /* Poll epoch sub-system in non-blocking manner. */
+ ck_epoch_poll(record);
+ return;
+}
+.Ed
+.Sh RETURN VALUES
+This function has no return value.
+.Sh ERRORS
+The object pointed to by
+.Fa record
+must have been previously registered via
+.Fn ck_epoch_register 3 .
+.Sh SEE ALSO
+.Xr ck_epoch_init 3 ,
+.Xr ck_epoch_register 3 ,
+.Xr ck_epoch_unregister 3 ,
+.Xr ck_epoch_recycle 3 ,
+.Xr ck_epoch_poll 3 ,
+.Xr ck_epoch_synchronize 3 ,
+.Xr ck_epoch_reclaim 3 ,
+.Xr ck_epoch_barrier 3 ,
+.Xr ck_epoch_begin 3 ,
+.Xr ck_epoch_end 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_epoch_end b/doc/ck_epoch_end
new file mode 100644
index 000000000000..a36afbd52c30
--- /dev/null
+++ b/doc/ck_epoch_end
@@ -0,0 +1,64 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd September 2, 2012
+.Dt CK_EPOCH_END 3
+.Sh NAME
+.Nm ck_epoch_end
+.Nd end epoch-protected segment of execution
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_epoch.h
+.Ft void
+.Fn ck_epoch_end "ck_epoch_record_t *record" "ck_epoch_section_t *section"
+.Sh DESCRIPTION
+The
+.Fn ck_epoch_end 3
+function will mark the end of an epoch-protected code section.
+.Fa section
+must point to a section object initialized previously with
+.Fn ck_epoch_begin 3 .
+.Sh RETURN VALUES
+This function has no return value.
+.Sh ERRORS
+The object pointed to by
+.Fa record
+must have been previously registered via
+.Fn ck_epoch_register 3 .
+.Sh SEE ALSO
+.Xr ck_epoch_init 3 ,
+.Xr ck_epoch_register 3 ,
+.Xr ck_epoch_unregister 3 ,
+.Xr ck_epoch_recycle 3 ,
+.Xr ck_epoch_poll 3 ,
+.Xr ck_epoch_synchronize 3 ,
+.Xr ck_epoch_reclaim 3 ,
+.Xr ck_epoch_barrier 3 ,
+.Xr ck_epoch_call 3 ,
+.Xr ck_epoch_begin 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_epoch_init b/doc/ck_epoch_init
new file mode 100644
index 000000000000..51a3e2abb46d
--- /dev/null
+++ b/doc/ck_epoch_init
@@ -0,0 +1,69 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd September 2, 2012
+.Dt CK_EPOCH_INIT 3
+.Sh NAME
+.Nm ck_epoch_init
+.Nd initialize epoch reclamation object
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_epoch.h
+.Ft void
+.Fn ck_epoch_init "ck_epoch_t *epoch"
+.Sh DESCRIPTION
+The
+.Fn ck_epoch_init
+function initializes the epoch object pointed to by the
+.Fa epoch
+pointer.
+.Sh RETURN VALUES
+This function has no return value.
+.Sh ERRORS
+.Bl -tag -width Er
+.Pp
+The behavior of
+.Fn ck_epoch_init
+is undefined if
+.Fa epoch
+is not a pointer to a
+.Tn ck_epoch_t
+object.
+.El
+.Sh SEE ALSO
+.Xr ck_epoch_register 3 ,
+.Xr ck_epoch_unregister 3 ,
+.Xr ck_epoch_recycle 3 ,
+.Xr ck_epoch_poll 3 ,
+.Xr ck_epoch_synchronize 3 ,
+.Xr ck_epoch_reclaim 3 ,
+.Xr ck_epoch_barrier 3 ,
+.Xr ck_epoch_call 3 ,
+.Xr ck_epoch_begin 3 ,
+.Xr ck_epoch_end 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_epoch_poll b/doc/ck_epoch_poll
new file mode 100644
index 000000000000..68c4a4e80766
--- /dev/null
+++ b/doc/ck_epoch_poll
@@ -0,0 +1,71 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd September 2, 2012
+.Dt CK_EPOCH_POLL 3
+.Sh NAME
+.Nm ck_epoch_poll
+.Nd non-blocking poll of epoch object for dispatch cycles
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_epoch.h
+.Ft bool
+.Fn ck_epoch_poll "ck_epoch_record_t *record"
+.Sh DESCRIPTION
+The
+.Fn ck_epoch_poll 3
+function will attempt to dispatch any functions associated with the
+object pointed to by
+.Fa epoch
+via
+.Fn ck_epoch_call 3
+if deemed safe. This function is meant to be used in cases epoch
+reclamation cost must be amortized over time in a manner that does
+not affect caller progress.
+.Sh RETURN VALUES
+This function will return true if at least one function was dispatched.
+This function will return false if it has determined not all threads have
+observed the latest generation of epoch-protected objects. Neither value
+indicates an error.
+.Sh ERRORS
+Behavior is undefined if the object pointed to by
+.Fa record
+has not have been previously registered via
+.Fn ck_epoch_register 3 .
+.Sh SEE ALSO
+.Xr ck_epoch_init 3 ,
+.Xr ck_epoch_register 3 ,
+.Xr ck_epoch_unregister 3 ,
+.Xr ck_epoch_recycle 3 ,
+.Xr ck_epoch_synchronize 3 ,
+.Xr ck_epoch_reclaim 3 ,
+.Xr ck_epoch_barrier 3 ,
+.Xr ck_epoch_call 3 ,
+.Xr ck_epoch_begin 3 ,
+.Xr ck_epoch_end 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_epoch_reclaim b/doc/ck_epoch_reclaim
new file mode 100644
index 000000000000..ffe3bac5716c
--- /dev/null
+++ b/doc/ck_epoch_reclaim
@@ -0,0 +1,92 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd May 2, 2013
+.Dt CK_EPOCH_RECLAIM 3
+.Sh NAME
+.Nm ck_epoch_reclaim
+.Nd immediately execute all deferred callbacks
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_epoch.h
+.Ft void
+.Fn ck_epoch_reclaim "ck_epoch_record_t *record"
+.Sh DESCRIPTION
+The
+.Fn ck_epoch_reclaim 3
+function will unconditionally execute all callbacks
+that have been deferred with
+.Fn ck_epoch_call 3 .
+.Sh EXAMPLE
+.Bd -literal -offset indent
+
+#include <ck_epoch.h>
+#include <ck_stack.h>
+#include <stdlib.h>
+
+/*
+ * epoch was previously initialized with ck_epoch_init.
+ */
+ck_epoch_t *epoch;
+
+void
+function(void)
+{
+ ck_epoch_record_t *record;
+
+ logically_delete(object);
+ ck_epoch_call(epoch, record, &object->epoch_entry, destructor);
+
+ /*
+ * Wait until no threads could possibly have a reference to the
+ * object we just deleted.
+ */
+ ck_epoch_synchronize(epoch, record);
+
+ /*
+ * Execute all deferred callbacks.
+ */
+ ck_epoch_reclaim(record);
+
+ return;
+}
+.Ed
+.Sh RETURN VALUES
+This function has no return value.
+.Sh SEE ALSO
+.Xr ck_epoch_init 3 ,
+.Xr ck_epoch_register 3 ,
+.Xr ck_epoch_unregister 3 ,
+.Xr ck_epoch_recycle 3 ,
+.Xr ck_epoch_poll 3 ,
+.Xr ck_epoch_reclaim 3 ,
+.Xr ck_epoch_barrier 3 ,
+.Xr ck_epoch_call 3 ,
+.Xr ck_epoch_begin 3 ,
+.Xr ck_epoch_end 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_epoch_recycle b/doc/ck_epoch_recycle
new file mode 100644
index 000000000000..530079c3e925
--- /dev/null
+++ b/doc/ck_epoch_recycle
@@ -0,0 +1,102 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd September 2, 2012
+.Dt CK_EPOCH_RECYCLE 3
+.Sh NAME
+.Nm ck_epoch_recycle
+.Nd return an epoch record that may be used by caller
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_epoch.h
+.Ft ck_epoch_record_t *
+.Fn ck_epoch_recycle "ck_epoch_t *epoch"
+.Sh DESCRIPTION
+The
+.Fn ck_epoch_recycle 3
+function attempts to return an unused epoch record object for use by
+the caller. These epoch records were associated with previous calls
+to the
+.Fn ck_epoch_unregister 3
+function.
+.Sh EXAMPLE
+.Bd -literal -offset indent
+#include <ck_epoch.h>
+#include <stdlib.h>
+
+/*
+ * epoch was previously initialized with ck_epoch_init.
+ */
+ck_epoch_t *epoch;
+
+void
+function(void)
+{
+ ck_epoch_record_t *record;
+
+ record = ck_epoch_recycle(&epoch);
+ if (record == NULL) {
+ record = malloc(sizeof *record);
+ if (record == NULL)
+ return;
+
+ ck_epoch_register(&epoch, record);
+ }
+
+ /*
+ * After we are done, we will unregister the record so it
+ * can be used by other new participants in the epoch system
+ * provided by the object pointed to by "epoch".
+ */
+ ck_epoch_unregister(&epoch, record);
+ return;
+}
+.Ed
+.Sh RETURN VALUES
+This function returns a pointer to a
+.Dv ck_epoch_record_t
+object. If no unused record was found to be associated with the
+object pointed to by
+.Fa epoch ,
+then the function will return NULL.
+.Sh ERRORS
+Behavior is undefined if the object pointed to by
+.Fa epoch
+is not a valid epoch object.
+.Sh SEE ALSO
+.Xr ck_epoch_init 3 ,
+.Xr ck_epoch_register 3 ,
+.Xr ck_epoch_unregister 3 ,
+.Xr ck_epoch_poll 3 ,
+.Xr ck_epoch_synchronize 3 ,
+.Xr ck_epoch_reclaim 3 ,
+.Xr ck_epoch_barrier 3 ,
+.Xr ck_epoch_call 3 ,
+.Xr ck_epoch_begin 3 ,
+.Xr ck_epoch_end 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_epoch_register b/doc/ck_epoch_register
new file mode 100644
index 000000000000..85ea4610a682
--- /dev/null
+++ b/doc/ck_epoch_register
@@ -0,0 +1,67 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd September 2, 2012
+.Dt CK_EPOCH_REGISTER 3
+.Sh NAME
+.Nm ck_epoch_register
+.Nd register a thread for epoch reclamation
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_epoch.h
+.Ft void
+.Fn ck_epoch_register "ck_epoch_t *epoch" "ck_epoch_record_t *record"
+.Sh DESCRIPTION
+The
+.Fn ck_epoch_register 3
+function associates a record object specified by the
+.Fa record
+pointer with the epoch object pointed to by
+.Fa epoch .
+Any thread or processor that will require safe memory reclamation
+guarantees must register a unique record object. After registration, the
+object pointed to by the
+.Fa record
+argument will have lifetime managed by the underlying epoch sub-system.
+The record object must not be destroyed after it is associated with a
+.Fn ck_epoch_register 3
+call.
+.Sh RETURN VALUES
+This function has no return value.
+.Sh SEE ALSO
+.Xr ck_epoch_init 3 ,
+.Xr ck_epoch_unregister 3 ,
+.Xr ck_epoch_recycle 3 ,
+.Xr ck_epoch_poll 3 ,
+.Xr ck_epoch_synchronize 3 ,
+.Xr ck_epoch_reclaim 3 ,
+.Xr ck_epoch_barrier 3 ,
+.Xr ck_epoch_call 3 ,
+.Xr ck_epoch_begin 3 ,
+.Xr ck_epoch_end 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_epoch_synchronize b/doc/ck_epoch_synchronize
new file mode 100644
index 000000000000..6c9a69843c7a
--- /dev/null
+++ b/doc/ck_epoch_synchronize
@@ -0,0 +1,119 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd September 2, 2012
+.Dt CK_EPOCH_SYNCHRONIZE 3
+.Sh NAME
+.Nm ck_epoch_synchronize
+.Nd block until a grace period has been detected
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_epoch.h
+.Ft void
+.Fn ck_epoch_synchronize "ck_epoch_record_t *record"
+.Sh DESCRIPTION
+The
+.Fn ck_epoch_synchronize 3
+function will block the caller until a grace period has been
+detected, according to the semantics of epoch reclamation.
+Any objects requiring safe memory reclamation which are logically
+deleted are safe for physical deletion following a call to
+.Fn ck_epoch_synchronize 3 .
+If you require that all callbacks be dispatched, then it is suggested
+that you use
+.Fn ck_epoch_barrier 3
+instead or follow a call of
+.Fn ck_epoch_synchronize 3
+with
+.Fn ck_epoch_reclaim 3 .
+.Sh EXAMPLE
+.Bd -literal -offset indent
+
+#include <ck_epoch.h>
+#include <ck_stack.h>
+#include <stdlib.h>
+
+/*
+ * epoch was previously initialized with ck_epoch_init.
+ * stack was previously initialized with ck_stack_init.
+ */
+ck_epoch_t *epoch;
+ck_stack_t *stack;
+
+void
+function(void)
+{
+ ck_epoch_record_t *record;
+ ck_stack_entry_t *s;
+
+ record = malloc(sizeof *record);
+ ck_epoch_register(&epoch, record);
+
+ /*
+ * We are using an epoch section here to guarantee no
+ * nodes in the stack are deleted while we are dereferencing
+ * them. This is needed here because there are multiple writers.
+ * If there was only one thread popping from the this stack,
+ * then there is no need to ck_epoch_begin/ck_epoch_end.
+ */
+ ck_epoch_begin(record);
+
+ /* Logically delete an object. */
+ s = ck_stack_pop_upmc(stack);
+
+ ck_epoch_end(record);
+
+ /*
+ * Wait until no threads could possibly have a reference to the
+ * object we just popped (assume all threads are simply executing
+ * ck_stack_pop_upmc).
+ */
+ ck_epoch_synchronize(record);
+
+ /* It is now safe to physically delete the object. */
+ free(s);
+ return;
+}
+.Ed
+.Sh RETURN VALUES
+This function has no return value.
+.Sh ERRORS
+The object pointed to by .Fa record must have been previously registered via
+.Fn ck_epoch_register 3 .
+.Sh SEE ALSO
+.Xr ck_epoch_init 3 ,
+.Xr ck_epoch_register 3 ,
+.Xr ck_epoch_unregister 3 ,
+.Xr ck_epoch_recycle 3 ,
+.Xr ck_epoch_poll 3 ,
+.Xr ck_epoch_reclaim 3 ,
+.Xr ck_epoch_barrier 3 ,
+.Xr ck_epoch_call 3 ,
+.Xr ck_epoch_begin 3 ,
+.Xr ck_epoch_end 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_epoch_unregister b/doc/ck_epoch_unregister
new file mode 100644
index 000000000000..3be537f45614
--- /dev/null
+++ b/doc/ck_epoch_unregister
@@ -0,0 +1,65 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd September 2, 2012
+.Dt CK_EPOCH_UNREGISTER 3
+.Sh NAME
+.Nm ck_epoch_unregister
+.Nd unregister a thread for epoch reclamation
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_epoch.h
+.Ft void
+.Fn ck_epoch_unregister "ck_epoch_record_t *record"
+.Sh DESCRIPTION
+The
+.Fn ck_epoch_unregister 3
+function allows for the record pointed by the
+.Fa record
+pointer to be used as a return value by the
+.Fn ck_epoch_recycle 3
+function. This record can now be used by another thread
+of execution. Behavior is undefined if the object pointed by
+.Fa record
+is modified in any way, even after a call is made to the
+.Fn ck_epoch_unregister 3
+function.
+.Sh RETURN VALUES
+This function has no return value.
+.Sh SEE ALSO
+.Xr ck_epoch_init 3 ,
+.Xr ck_epoch_register 3 ,
+.Xr ck_epoch_recycle 3 ,
+.Xr ck_epoch_poll 3 ,
+.Xr ck_epoch_synchronize 3 ,
+.Xr ck_epoch_reclaim 3 ,
+.Xr ck_epoch_barrier 3 ,
+.Xr ck_epoch_call 3 ,
+.Xr ck_epoch_begin 3 ,
+.Xr ck_epoch_end 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_hs_apply b/doc/ck_hs_apply
new file mode 100644
index 000000000000..5664f73b90a0
--- /dev/null
+++ b/doc/ck_hs_apply
@@ -0,0 +1,86 @@
+.\"
+.\" Copyright 2014 Samy Al Bahra.
+.\" Copyright 2014 Backtrace I/O, Inc.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd September 1, 2014
+.Dt CK_HS_APPLY 3
+.Sh NAME
+.Nm ck_hs_apply
+.Nd apply a function to hash set value
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_hs.h
+.Ft void *
+.Fn ck_hs_apply_fn_t "void *key" "void *closure"
+.Ft bool
+.Fn ck_hs_apply "ck_hs_t *hs" "unsigned long hash" "const void *key" "ck_hs_apply_fn_t *function" "void *argument"
+.Sh DESCRIPTION
+The
+.Fn ck_hs_apply 3
+function will lookup the hash set slot associated with
+.Fa key
+and pass it to function pointed to by
+.Fa function
+for further action. This callback may remove or replace
+the value by respectively returning NULL or a pointer to
+another object with an identical key. The first argument
+passed to
+.Fa function
+is a pointer to the object found in the hash set and
+the second argument is the
+.Fa argument
+pointer passed to
+.Fn ck_hs_apply 3 .
+If the pointer returned by
+.Fa function
+is equivalent to the first argument then no modification
+is made to the hash set.
+.Sh RETURN VALUES
+Upon successful completion,
+.Fn ck_hs_apply 3
+returns true and otherwise returns false on failure.
+.Sh SEE ALSO
+.Xr ck_hs_init 3 ,
+.Xr ck_hs_move 3 ,
+.Xr ck_hs_destroy 3 ,
+.Xr ck_hs_fas 3 ,
+.Xr CK_HS_HASH 3 ,
+.Xr ck_hs_iterator_init 3 ,
+.Xr ck_hs_next 3 ,
+.Xr ck_hs_get 3 ,
+.Xr ck_hs_put 3 ,
+.Xr ck_hs_put_unique 3 ,
+.Xr ck_hs_remove 3 ,
+.Xr ck_hs_grow 3 ,
+.Xr ck_hs_rebuild 3 ,
+.Xr ck_hs_gc 3 ,
+.Xr ck_hs_count 3 ,
+.Xr ck_hs_reset 3 ,
+.Xr ck_hs_reset_size 3 ,
+.Xr ck_hs_stat 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_hs_count b/doc/ck_hs_count
new file mode 100644
index 000000000000..c12d8f76289f
--- /dev/null
+++ b/doc/ck_hs_count
@@ -0,0 +1,70 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd September 17, 2012
+.Dt CK_HS_COUNT 3
+.Sh NAME
+.Nm ck_hs_count
+.Nd returns number of entries in hash set
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_hs.h
+.Ft unsigned long
+.Fn ck_hs_count "ck_hs_t *hs"
+.Sh DESCRIPTION
+The
+.Fn ck_hs_count 3
+function returns the number of keys currently
+stored in
+.Fa hs .
+.Sh ERRORS
+Behavior is undefined if
+.Fa hs
+is uninitialized. Behavior is
+undefined if this function is called by a non-writer
+thread.
+.Sh SEE ALSO
+.Xr ck_hs_init 3 ,
+.Xr ck_hs_move 3 ,
+.Xr ck_hs_destroy 3 ,
+.Xr CK_HS_HASH 3 ,
+.Xr ck_hs_iterator_init 3 ,
+.Xr ck_hs_next 3 ,
+.Xr ck_hs_get 3 ,
+.Xr ck_hs_put 3 ,
+.Xr ck_hs_put_unique 3 ,
+.Xr ck_hs_set 3 ,
+.Xr ck_hs_fas 3 ,
+.Xr ck_hs_remove 3 ,
+.Xr ck_hs_grow 3 ,
+.Xr ck_hs_rebuild 3 ,
+.Xr ck_hs_gc 3 ,
+.Xr ck_hs_reset 3 ,
+.Xr ck_hs_reset_size 3 ,
+.Xr ck_hs_stat 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_hs_destroy b/doc/ck_hs_destroy
new file mode 100644
index 000000000000..952502ba7144
--- /dev/null
+++ b/doc/ck_hs_destroy
@@ -0,0 +1,77 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd September 17, 2012
+.Dt CK_HS_DESTROY 3
+.Sh NAME
+.Nm ck_hs_destroy
+.Nd destroy hash set
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_hs.h
+.Ft void
+.Fn ck_hs_destroy "ck_hs_t *hs"
+.Sh DESCRIPTION
+The
+.Fn ck_hs_destroy 3
+function will request that the underlying allocator, as specified by the
+.Xr ck_hs_init 3
+function, immediately destroy the object pointed to by the
+.Fa hs
+argument.
+The user must guarantee that no threads are accessing the object pointed to
+by
+.Fa hs
+when
+.Fn ck_hs_destroy 3
+is called.
+.Sh RETURN VALUES
+.Fn ck_hs_destroy 3
+has no return value.
+.Sh ERRORS
+This function is guaranteed not to fail.
+.Sh SEE ALSO
+.Xr ck_hs_init 3 ,
+.Xr ck_hs_move 3 ,
+.Xr CK_HS_HASH 3 ,
+.Xr ck_hs_iterator_init 3 ,
+.Xr ck_hs_next 3 ,
+.Xr ck_hs_get 3 ,
+.Xr ck_hs_put 3 ,
+.Xr ck_hs_put_unique 3 ,
+.Xr ck_hs_set 3 ,
+.Xr ck_hs_fas 3 ,
+.Xr ck_hs_remove 3 ,
+.Xr ck_hs_grow 3 ,
+.Xr ck_hs_rebuild 3 ,
+.Xr ck_hs_gc 3 ,
+.Xr ck_hs_count 3 ,
+.Xr ck_hs_reset 3 ,
+.Xr ck_hs_reset_size 3 ,
+.Xr ck_hs_stat 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_hs_fas b/doc/ck_hs_fas
new file mode 100644
index 000000000000..69760b56c980
--- /dev/null
+++ b/doc/ck_hs_fas
@@ -0,0 +1,98 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd June 20, 2013
+.Dt CK_HS_FAS 3
+.Sh NAME
+.Nm ck_hs_fas
+.Nd fetch and store key in hash set
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_hs.h
+.Ft bool
+.Fn ck_hs_fas "ck_hs_t *hs" "unsigned long hash" "const void *key" "void **previous"
+.Sh DESCRIPTION
+The
+.Fn ck_hs_fas 3
+function will fetch and store the key specified by the
+.Fa key
+argument in the hash set pointed to by the
+.Fa hs
+argument. The key specified by
+.Fa key
+is expected to have the hash value specified by the
+.Fa hash
+argument (which was previously generated using the
+.Xr CK_HS_HASH 3
+macro).
+.Pp
+If the call to
+.Fn ck_hs_fas 3
+was successful then the key specified by
+.Fa key
+was successfully stored in the hash set pointed to by
+.Fa hs .
+The key must already exist in the hash set, and is
+replaced by
+.Fa key
+and the previous value is stored into the void pointer
+pointed to by the
+.Fa previous
+argument. If the key does not exist in the hash set
+then the function will return false and the hash set
+is unchanged. This function
+is guaranteed to be stable with respect to memory usage.
+.Sh RETURN VALUES
+Upon successful completion,
+.Fn ck_hs_fas 3
+returns true and otherwise returns false on failure.
+.Sh ERRORS
+Behavior is undefined if
+.Fa key
+or
+.Fa hs
+are uninitialized.
+.Sh SEE ALSO
+.Xr ck_hs_init 3 ,
+.Xr ck_hs_move 3 ,
+.Xr ck_hs_destroy 3 ,
+.Xr CK_HS_HASH 3 ,
+.Xr ck_hs_iterator_init 3 ,
+.Xr ck_hs_next 3 ,
+.Xr ck_hs_get 3 ,
+.Xr ck_hs_put 3 ,
+.Xr ck_hs_put_unique 3 ,
+.Xr ck_hs_remove 3 ,
+.Xr ck_hs_grow 3 ,
+.Xr ck_hs_rebuild 3 ,
+.Xr ck_hs_gc 3 ,
+.Xr ck_hs_count 3 ,
+.Xr ck_hs_reset 3 ,
+.Xr ck_hs_reset_size 3 ,
+.Xr ck_hs_stat 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_hs_gc b/doc/ck_hs_gc
new file mode 100644
index 000000000000..85abba2e3e6c
--- /dev/null
+++ b/doc/ck_hs_gc
@@ -0,0 +1,88 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd December 17, 2013
+.Dt CK_HS_GC 3
+.Sh NAME
+.Nm ck_hs_gc
+.Nd perform maintenance on a hash set
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_hs.h
+.Ft bool
+.Fn ck_hs_gc "ck_hs_t *hs" "unsigned long cycles" "unsigned long seed"
+.Sh DESCRIPTION
+The
+.Fn ck_hs_gc 3
+function will perform various maintenance routines on the hash set
+pointed to by
+.Fa hs ,
+including defragmentation of probe sequences with respect to tombstones
+and in the case that the delete workload hint has been passed, recalculation
+of probe sequence bounds. The
+.Fa cycles
+argument is used to indicate how many hash set entries should be subject
+to attempted maintenance. If
+.Fa cycles
+is 0, then maintenance is performed on the complete hash set. The
+.Fa seed
+argument determines the start location of the maintenance process. If
+.Fa cycles
+is non-zero, it is recommended that
+.Fa seed
+is some random value. If the delete hint has been passed, the function
+will require an additional 12% of memory (with respect to existing
+memory usage of the set), until operation completion.
+.Sh RETURN VALUES
+Upon successful completion,
+.Fn ck_hs_gc 3
+returns true and otherwise returns false on failure due to memory allocation
+failure.
+.Sh ERRORS
+This function will only return false if there are internal memory allocation
+failures.
+.Sh SEE ALSO
+.Xr ck_hs_init 3 ,
+.Xr ck_hs_move 3 ,
+.Xr ck_hs_destroy 3 ,
+.Xr CK_HS_HASH 3 ,
+.Xr ck_hs_iterator_init 3 ,
+.Xr ck_hs_next 3 ,
+.Xr ck_hs_get 3 ,
+.Xr ck_hs_put 3 ,
+.Xr ck_hs_put_unique 3 ,
+.Xr ck_hs_grow 3 ,
+.Xr ck_hs_rebuild 3 ,
+.Xr ck_hs_set 3 ,
+.Xr ck_hs_fas 3 ,
+.Xr ck_hs_remove 3 ,
+.Xr ck_hs_count 3 ,
+.Xr ck_hs_reset 3 ,
+.Xr ck_hs_reset_size 3 ,
+.Xr ck_hs_stat 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_hs_get b/doc/ck_hs_get
new file mode 100644
index 000000000000..9c1600d6a9bc
--- /dev/null
+++ b/doc/ck_hs_get
@@ -0,0 +1,88 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd September 17, 2012
+.Dt CK_HS_GET 3
+.Sh NAME
+.Nm ck_hs_get
+.Nd load a key from a hash set
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_hs.h
+.Ft void *
+.Fn ck_hs_get "ck_hs_t *hs" "unsigned long hash" "const void *key"
+.Sh DESCRIPTION
+The
+.Fn ck_hs_get 3
+function will return a pointer to a key in the hash set
+.Fa hs
+that is of equivalent value to the object pointed to by
+.Fa key .
+The key specified by
+.Fa key
+is expected to have the hash value specified by the
+.Fa hash
+argument (which is to have been previously generated using the
+.Xr CK_HS_HASH 3
+macro).
+.Sh RETURN VALUES
+If the provided key is a member of
+.Fa hs
+then a pointer to the key as stored in
+.Fa hs
+is returned. If the key was not found in
+.Fa hs
+then a value of
+.Dv NULL
+is returned.
+.Sh ERRORS
+Behavior is undefined if
+.Fa entry
+or
+.Fa hs
+are uninitialized.
+.Sh SEE ALSO
+.Xr ck_hs_init 3 ,
+.Xr ck_hs_move 3 ,
+.Xr ck_hs_destroy 3 ,
+.Xr CK_HS_HASH 3 ,
+.Xr ck_hs_iterator_init 3 ,
+.Xr ck_hs_next 3 ,
+.Xr ck_hs_put 3 ,
+.Xr ck_hs_put_unique 3 ,
+.Xr ck_hs_set 3 ,
+.Xr ck_hs_fas 3 ,
+.Xr ck_hs_remove 3 ,
+.Xr ck_hs_grow 3 ,
+.Xr ck_hs_rebuild 3 ,
+.Xr ck_hs_gc 3 ,
+.Xr ck_hs_count 3 ,
+.Xr ck_hs_reset 3 ,
+.Xr ck_hs_reset_size 3 ,
+.Xr ck_hs_stat 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_hs_grow b/doc/ck_hs_grow
new file mode 100644
index 000000000000..ed35cd041564
--- /dev/null
+++ b/doc/ck_hs_grow
@@ -0,0 +1,81 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd September 17, 2012
+.Dt CK_HS_GROW 3
+.Sh NAME
+.Nm ck_hs_grow
+.Nd enlarge hash set capacity
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_hs.h
+.Ft bool
+.Fn ck_hs_grow "ck_hs_t *hs" "unsigned long capacity"
+.Sh DESCRIPTION
+The
+.Fn ck_hs_grow 3
+function will resize the hash set in order to be
+able to store at least the number of entries specified by
+.Fa capacity
+at a load factor of one. The default hash set load factor
+is 0.5. If you wish to minimize the likelihood of memory allocations
+for a hash set meant to store n entries, then specify a
+.Fa capacity
+of 2n. The default behavior of ck_hs is to round
+.Fa capacity
+to the next power of two if it is not already a power of two.
+.Sh RETURN VALUES
+Upon successful completion,
+.Fn ck_hs_grow 3
+returns true and otherwise returns false on failure.
+.Sh ERRORS
+Behavior is undefined if
+.Fa hs
+is uninitialized. This function will only
+return false if there are internal memory allocation
+failures.
+.Sh SEE ALSO
+.Xr ck_hs_init 3 ,
+.Xr ck_hs_move 3 ,
+.Xr ck_hs_destroy 3 ,
+.Xr CK_HS_HASH 3 ,
+.Xr ck_hs_iterator_init 3 ,
+.Xr ck_hs_next 3 ,
+.Xr ck_hs_get 3 ,
+.Xr ck_hs_put 3 ,
+.Xr ck_hs_put_unique 3 ,
+.Xr ck_hs_set 3 ,
+.Xr ck_hs_fas 3 ,
+.Xr ck_hs_remove 3 ,
+.Xr ck_hs_rebuild 3 ,
+.Xr ck_hs_gc 3 ,
+.Xr ck_hs_count 3 ,
+.Xr ck_hs_reset 3 ,
+.Xr ck_hs_reset_size 3 ,
+.Xr ck_hs_stat 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_hs_init b/doc/ck_hs_init
new file mode 100644
index 000000000000..cfcbf635d52b
--- /dev/null
+++ b/doc/ck_hs_init
@@ -0,0 +1,169 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd September 17, 2012
+.Dt CK_HS_INIT 3
+.Sh NAME
+.Nm ck_hs_init
+.Nd initialize a hash set
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_hs.h
+.Ft typedef unsigned long
+.Fn ck_hs_hash_cb_t "const void *key" "unsigned long seed"
+.Ft typedef bool
+.Fn ck_hs_compare_cb_t "const void *c1" "const void *c2"
+.Ft bool
+.Fn ck_hs_init "ck_hs_t *hs" "unsigned int mode" "ck_hs_hash_cb_t *hash_function" "ck_hs_compare_cb_t *compare" "struct ck_malloc *allocator" "unsigned long capacity" "unsigned long seed"
+.Sh DESCRIPTION
+The
+.Fn ck_hs_init
+function initializes the hash set pointed to by the
+.Fa hs
+pointer.
+.Pp
+The argument
+.Fa mode
+specifies the type of key-value pairs to be stored in the
+hash set as well as the expected concurrent access model.
+The value of
+.Fa mode
+consists of a bitfield of one of the following:
+.Bl -tag -width indent
+.It CK_HS_MODE_OBJECT
+The hash set is meant to store pointers to objects. This provides
+a hint that only CK_MD_VMA_BITS are necessary to encode the key
+argument. Any unused pointer bits are leveraged for internal
+optimizations.
+.It CK_HS_MODE_DIRECT
+The hash set is meant to directly store key values and that all
+bits of the key are used to encode values.
+.El
+.Pp
+The concurrent access model is specified by:
+.Bl -tag -width indent
+.It CK_HS_MODE_SPMC
+The hash set should allow for concurrent readers in the
+presence of a single writer.
+.It CK_HS_MODE_MPMC
+The hash set should allow for concurrent readers in the
+presence of concurrent writers. This is currently unsupported.
+.El
+.Pp
+The developer is free to specify additional workload hints.
+These hints are one of:
+.Bl -tag -width indent
+.It CK_HS_MODE_DELETE
+The hash set is expected to have a delete-heavy workload.
+At the cost of approximately 13% increased memory usage,
+allow for stronger per-slot probe bounds to combat the
+effects of tombstone accumulation.
+.El
+.Pp
+The argument
+.Fa hash_function
+is a mandatory pointer to a user-specified hash function.
+A user-specified hash function takes two arguments. The
+.Fa key
+argument is a pointer to a key. The
+.Fa seed
+argument is the initial seed associated with the hash set.
+This initial seed is specified by the user in
+.Xr ck_hs_init 3 .
+.Pp
+The
+.Fa compare
+argument is an optional pointer to a user-specified
+key comparison function. If NULL is specified in this
+argument, then pointer equality will be used to determine
+key equality. A user-specified comparison function takes
+two arguments representing pointers to the objects being
+compared for equality. It is expected to return true
+if the keys are of equal value and false otherwise.
+.Pp
+The
+.Fa allocator
+argument is a pointer to a structure containing
+.Fa malloc
+and
+.Fa free
+function pointers which respectively define the memory allocation and
+destruction functions to be used by the hash set being initialized.
+.Pp
+The argument
+.Fa capacity
+represents the initial number of keys the hash
+set is expected to contain. This argument is simply a hint
+and the underlying implementation is free to allocate more
+or less memory than necessary to contain the number of entries
+.Fa capacity
+specifies.
+.Pp
+The argument
+.Fa seed
+specifies the initial seed used by the underlying hash function.
+The user is free to choose a value of their choice.
+.Sh RETURN VALUES
+Upon successful completion
+.Fn ck_hs_init
+returns a value of
+.Dv true
+and otherwise returns a value of
+.Dv false
+to indicate an error.
+.Sh ERRORS
+.Bl -tag -width Er
+.Pp
+The behavior of
+.Fn ck_hs_init
+is undefined if
+.Fa hs
+is not a pointer to a
+.Tn ck_hs_t
+object.
+.El
+.Sh SEE ALSO
+.Xr ck_hs_move 3 ,
+.Xr ck_hs_destroy 3 ,
+.Xr CK_HS_HASH 3 ,
+.Xr ck_hs_iterator_init 3 ,
+.Xr ck_hs_next 3 ,
+.Xr ck_hs_get 3 ,
+.Xr ck_hs_put 3 ,
+.Xr ck_hs_put_unique 3 ,
+.Xr ck_hs_set 3 ,
+.Xr ck_hs_fas 3 ,
+.Xr ck_hs_remove 3 ,
+.Xr ck_hs_grow 3 ,
+.Xr ck_hs_rebuild 3 ,
+.Xr ck_hs_gc 3 ,
+.Xr ck_hs_count 3 ,
+.Xr ck_hs_reset 3 ,
+.Xr ck_hs_reset_size 3 ,
+.Xr ck_hs_stat 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_hs_iterator_init b/doc/ck_hs_iterator_init
new file mode 100644
index 000000000000..d2c25ccdb060
--- /dev/null
+++ b/doc/ck_hs_iterator_init
@@ -0,0 +1,78 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd September 17, 2012
+.Dt CK_HS_ITERATOR_INIT 3
+.Sh NAME
+.Nm ck_hs_iterator_init
+.Nd initialize hash set iterator
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_hs.h
+.Pp
+.Dv ck_hs_iterator_t iterator = CK_HS_ITERATOR_INITIALIZER
+.Pp
+.Ft void
+.Fn ck_hs_iterator_init "ck_hs_iterator_t *iterator"
+.Sh DESCRIPTION
+The
+.Fn ck_hs_iterator_init 3
+function will initialize the object pointed to
+by the
+.Fa iterator
+argument. Alternatively, an iterator may be statically
+initialized by assigning it to the CK_HS_ITERATOR_INITIALIZER value.
+.Pp
+An iterator is used to iterate through hash set entries with the
+.Xr ck_hs_next 3
+function.
+.Sh RETURN VALUES
+.Fn ck_hs_iterator_init 3
+has no return value.
+.Sh ERRORS
+This function will not fail.
+.Sh SEE ALSO
+.Xr ck_hs_init 3 ,
+.Xr ck_hs_move 3 ,
+.Xr ck_hs_destroy 3 ,
+.Xr CK_HS_HASH 3 ,
+.Xr ck_hs_next 3 ,
+.Xr ck_hs_get 3 ,
+.Xr ck_hs_put 3 ,
+.Xr ck_hs_put_unique 3 ,
+.Xr ck_hs_set 3 ,
+.Xr ck_hs_fas 3 ,
+.Xr ck_hs_remove 3 ,
+.Xr ck_hs_grow 3 ,
+.Xr ck_hs_rebuild 3 ,
+.Xr ck_hs_gc 3 ,
+.Xr ck_hs_count 3 ,
+.Xr ck_hs_reset 3 ,
+.Xr ck_hs_reset_size 3 ,
+.Xr ck_hs_stat 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_hs_move b/doc/ck_hs_move
new file mode 100644
index 000000000000..1d3019574176
--- /dev/null
+++ b/doc/ck_hs_move
@@ -0,0 +1,90 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd July 18, 2013
+.Dt CK_HS_MOVE 3
+.Sh NAME
+.Nm ck_hs_move
+.Nd move one from hash set to another
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_hs.h
+.Ft bool
+.Fn ck_hs_move "ck_hs_t *destination" "ck_hs_t *source" "ck_hs_hash_cb_t *hash_cb" "ck_hs_compare_cb_t *compare_cb" "struct ck_malloc *m"
+.Sh DESCRIPTION
+The
+.Fn ck_hs_move 3
+function will initialize
+.Fa source
+from
+.Fa destination .
+The hash function is set to
+.Fa hash_cb ,
+comparison function to
+.Fa compare_cb
+and the allocator callbacks to
+.Fa m .
+Further modifications to
+.Fa source
+will result in undefined behavior. Concurrent
+.Xr ck_hs_get 3
+and
+.Xr ck_hs_fas 3
+operations to
+.Fa source
+are legal until the next write operation to
+.Fa destination .
+.Pp
+This operation moves ownership from one hash set object
+to another and re-assigns callback functions to developer-specified
+values. This allows for dynamic configuration of allocation
+callbacks and is necessary for use-cases involving executable code
+which may be unmapped underneath the hash set.
+.Sh RETURN VALUES
+Upon successful completion
+.Fn ck_hs_move 3
+returns true and otherwise returns false to indicate an error.
+.Sh SEE ALSO
+.Xr ck_hs_init 3 ,
+.Xr ck_hs_destroy 3 ,
+.Xr CK_HS_HASH 3 ,
+.Xr ck_hs_iterator_init 3 ,
+.Xr ck_hs_next 3 ,
+.Xr ck_hs_put 3 ,
+.Xr ck_hs_put_unique 3 ,
+.Xr ck_hs_set 3 ,
+.Xr ck_hs_fas 3 ,
+.Xr ck_hs_remove 3 ,
+.Xr ck_hs_grow 3 ,
+.Xr ck_hs_rebuild 3 ,
+.Xr ck_hs_gc 3 ,
+.Xr ck_hs_count 3 ,
+.Xr ck_hs_reset 3 ,
+.Xr ck_hs_reset_size 3 ,
+.Xr ck_hs_stat 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_hs_next b/doc/ck_hs_next
new file mode 100644
index 000000000000..67e083e57080
--- /dev/null
+++ b/doc/ck_hs_next
@@ -0,0 +1,92 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd September 17, 2012
+.Dt CK_HS_NEXT 3
+.Sh NAME
+.Nm ck_hs_next
+.Nd iterate to next entry in hash set
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_hs.h
+.Ft bool
+.Fn ck_hs_next "ck_hs_t *hs" "ck_hs_iterator_t *iterator" "void **entry"
+.Sh DESCRIPTION
+The
+.Fn ck_hs_next 3
+function will increment the iterator object pointed to by
+.Fa iterator
+to point to the next non-empty hash set entry. If
+.Fn ck_hs_next 3
+returns true then the pointer pointed to by
+.Fa entry
+is initialized to the current hash set key pointed to by the
+.Fa iterator
+object.
+.Pp
+It is expected that
+.Fa iterator
+has been initialized using the
+.Xr ck_hs_iterator_init 3
+function or statically initialized using CK_HS_ITERATOR_INITIALIZER.
+.Sh RETURN VALUES
+If
+.Fn ck_hs_next 3
+returns true then the object pointed to by
+.Fa entry
+points to a valid hash set key. If
+.Fn ck_hs_next 3
+returns false then the value of the object pointed to by
+.Fa entry
+is undefined.
+.Sh ERRORS
+Behavior is undefined if
+.Fa iterator
+or
+.Fa hs
+are uninitialized.
+.Sh SEE ALSO
+.Xr ck_hs_init 3 ,
+.Xr ck_hs_move 3 ,
+.Xr ck_hs_destroy 3 ,
+.Xr CK_HS_HASH 3 ,
+.Xr ck_hs_iterator_init 3 ,
+.Xr ck_hs_get 3 ,
+.Xr ck_hs_put 3 ,
+.Xr ck_hs_put_unique 3 ,
+.Xr ck_hs_set 3 ,
+.Xr ck_hs_fas 3 ,
+.Xr ck_hs_remove 3 ,
+.Xr ck_hs_grow 3 ,
+.Xr ck_hs_rebuild 3 ,
+.Xr ck_hs_gc 3 ,
+.Xr ck_hs_count 3 ,
+.Xr ck_hs_reset 3 ,
+.Xr ck_hs_reset_size 3 ,
+.Xr ck_hs_stat 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_hs_put b/doc/ck_hs_put
new file mode 100644
index 000000000000..8f8f55f18b1a
--- /dev/null
+++ b/doc/ck_hs_put
@@ -0,0 +1,98 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd September 17, 2012
+.Dt CK_HS_PUT 3
+.Sh NAME
+.Nm ck_hs_put
+.Nd store unique key into a hash set
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_hs.h
+.Ft bool
+.Fn ck_hs_put "ck_hs_t *hs" "unsigned long hash" "const void *key"
+.Sh DESCRIPTION
+The
+.Fn ck_hs_put 3
+function will store the key specified by the
+.Fa key
+argument in the hash set pointed to by the
+.Fa hs
+argument. The key specified by
+.Fa key
+is expected to have the hash value specified by the
+.Fa hash
+argument (which was previously generated using the
+.Xr CK_HS_HASH 3
+macro).
+.Pp
+If the call to
+.Fn ck_hs_put 3
+was successful then the key specified by
+.Fa key
+was successfully stored in the hash set pointed to by
+.Fa hs .
+The function will fail if a key with an
+equivalent value to
+.Fa key
+is already present in the hash set. For replacement
+semantics, please see the
+.Xr ck_hs_set 3
+function.
+.Sh RETURN VALUES
+Upon successful completion,
+.Fn ck_hs_put 3
+returns true and otherwise returns false on failure.
+.Sh ERRORS
+Behavior is undefined if
+.Fa key
+or
+.Fa hs
+are uninitialized. The function will also
+return false if the hash set could not be enlarged
+to accomodate key insertion.
+.Sh SEE ALSO
+.Xr ck_hs_init 3 ,
+.Xr ck_hs_move 3 ,
+.Xr ck_hs_destroy 3 ,
+.Xr CK_HS_HASH 3 ,
+.Xr ck_hs_iterator_init 3 ,
+.Xr ck_hs_next 3 ,
+.Xr ck_hs_put_unique 3 ,
+.Xr ck_hs_get 3 ,
+.Xr ck_hs_set 3 ,
+.Xr ck_hs_fas 3 ,
+.Xr ck_hs_remove 3 ,
+.Xr ck_hs_grow 3 ,
+.Xr ck_hs_rebuild 3 ,
+.Xr ck_hs_gc 3 ,
+.Xr ck_hs_count 3 ,
+.Xr ck_hs_reset 3 ,
+.Xr ck_hs_reset_size 3 ,
+.Xr ck_hs_stat 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_hs_put_unique b/doc/ck_hs_put_unique
new file mode 100644
index 000000000000..f60c5436332b
--- /dev/null
+++ b/doc/ck_hs_put_unique
@@ -0,0 +1,98 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd December 7, 2013
+.Dt CK_HS_PUT_UNIQUE 3
+.Sh NAME
+.Nm ck_hs_put_unique
+.Nd unconditionally store unique key into a hash set
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_hs.h
+.Ft bool
+.Fn ck_hs_put_unique "ck_hs_t *hs" "unsigned long hash" "const void *key"
+.Sh DESCRIPTION
+The
+.Fn ck_hs_put_unique 3
+function will store the key specified by the
+.Fa key
+argument in the hash set pointed to by the
+.Fa hs
+argument. The key specified by
+.Fa key
+is expected to have the hash value specified by the
+.Fa hash
+argument (which was previously generated using the
+.Xr CK_HS_HASH 3
+macro).
+.Pp
+If the call to
+.Fn ck_hs_put 3
+was successful then the key specified by
+.Fa key
+was successfully stored in the hash set pointed to by
+.Fa hs .
+The function will cause undefined behavior if a key with an
+equivalent value is already present in the hash set. For replacement
+semantics, please see the
+.Xr ck_hs_set 3
+function.
+.Sh RETURN VALUES
+Upon successful completion,
+.Fn ck_hs_put_unique 3
+returns true and otherwise returns false on failure.
+.Sh ERRORS
+Behavior is undefined if
+.Fa key
+or
+.Fa hs
+are uninitialized. The function will also
+return false if the hash set could not be enlarged
+to accomodate key insertion. The function will
+result in undefined behavior if called for an
+already inserted key value.
+.Sh SEE ALSO
+.Xr ck_hs_init 3 ,
+.Xr ck_hs_move 3 ,
+.Xr ck_hs_destroy 3 ,
+.Xr CK_HS_HASH 3 ,
+.Xr ck_hs_iterator_init 3 ,
+.Xr ck_hs_next 3 ,
+.Xr ck_hs_get 3 ,
+.Xr ck_hs_put 3 ,
+.Xr ck_hs_set 3 ,
+.Xr ck_hs_fas 3 ,
+.Xr ck_hs_remove 3 ,
+.Xr ck_hs_grow 3 ,
+.Xr ck_hs_rebuild 3 ,
+.Xr ck_hs_gc 3 ,
+.Xr ck_hs_count 3 ,
+.Xr ck_hs_reset 3 ,
+.Xr ck_hs_reset_size 3 ,
+.Xr ck_hs_stat 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_hs_rebuild b/doc/ck_hs_rebuild
new file mode 100644
index 000000000000..a49bb28f4560
--- /dev/null
+++ b/doc/ck_hs_rebuild
@@ -0,0 +1,76 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd December 7, 2013
+.Dt CK_HS_REBUILD 3
+.Sh NAME
+.Nm ck_hs_rebuild
+.Nd rebuild a hash set
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_hs.h
+.Ft bool
+.Fn ck_hs_rebuild "ck_hs_t *hs"
+.Sh DESCRIPTION
+The
+.Fn ck_hs_rebuild 3
+function will regenerate the hash set pointed to by
+.Fa hs .
+This has the side-effect of pruning degradatory side-effects
+of workloads that are delete heavy. The regenerated hash
+set should have shorter probe sequences on average. This
+operation will require a significant amount of memory
+and is free to allocate a duplicate hash set in the
+rebuild process.
+.Sh RETURN VALUES
+Upon successful completion,
+.Fn ck_hs_rebuild 3
+returns true and otherwise returns false on failure.
+.Sh ERRORS
+This function will only return false if there are internal memory allocation
+failures.
+.Sh SEE ALSO
+.Xr ck_hs_init 3 ,
+.Xr ck_hs_move 3 ,
+.Xr ck_hs_destroy 3 ,
+.Xr CK_HS_HASH 3 ,
+.Xr ck_hs_iterator_init 3 ,
+.Xr ck_hs_next 3 ,
+.Xr ck_hs_get 3 ,
+.Xr ck_hs_put 3 ,
+.Xr ck_hs_put_unique 3 ,
+.Xr ck_hs_set 3 ,
+.Xr ck_hs_fas 3 ,
+.Xr ck_hs_gc 3 ,
+.Xr ck_hs_grow 3 ,
+.Xr ck_hs_remove 3 ,
+.Xr ck_hs_count 3 ,
+.Xr ck_hs_reset 3 ,
+.Xr ck_hs_reset_size 3 ,
+.Xr ck_hs_stat 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_hs_remove b/doc/ck_hs_remove
new file mode 100644
index 000000000000..10ccfb6f3a57
--- /dev/null
+++ b/doc/ck_hs_remove
@@ -0,0 +1,92 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd September 17, 2012
+.Dt CK_HS_REMOVE 3
+.Sh NAME
+.Nm ck_hs_remove
+.Nd remove key from a hash set
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_hs.h
+.Ft void *
+.Fn ck_hs_remove "ck_hs_t *hs" "unsigned long hash" "const void *key"
+.Sh DESCRIPTION
+The
+.Fn ck_hs_remove 3
+function will attempt to remove the key specified by the
+.Fa key
+argument in the hash set pointed to by the
+.Fa hs
+argument. The key specified by
+.Fa key
+is expected to have the hash value specified by the
+.Fa hash
+argument (which was previously generated using the
+.Xr CK_HS_HASH 3
+macro).
+.Pp
+If the call to
+.Fn ck_hs_remove 3
+was successful then the key contained in the hash
+set is returned. If the key was not a member of the hash
+set then
+.Dv NULL
+is returned.
+.Sh RETURN VALUES
+Upon successful completion,
+.Fn ck_hs_remove 3
+returns a pointer to a key and otherwise returns
+.Dv NULL
+on failure.
+.Sh ERRORS
+Behavior is undefined if
+.Fa key
+or
+.Fa hs
+are uninitialized.
+.Sh SEE ALSO
+.Xr ck_hs_init 3 ,
+.Xr ck_hs_move 3 ,
+.Xr ck_hs_destroy 3 ,
+.Xr CK_HS_HASH 3 ,
+.Xr ck_hs_iterator_init 3 ,
+.Xr ck_hs_next 3 ,
+.Xr ck_hs_get 3 ,
+.Xr ck_hs_put 3 ,
+.Xr ck_hs_put_unique 3 ,
+.Xr ck_hs_set 3 ,
+.Xr ck_hs_fas 3 ,
+.Xr ck_hs_grow 3 ,
+.Xr ck_hs_gc 3 ,
+.Xr ck_hs_rebuild 3 ,
+.Xr ck_hs_count 3 ,
+.Xr ck_hs_reset 3 ,
+.Xr ck_hs_reset_size 3 ,
+.Xr ck_hs_stat 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_hs_reset b/doc/ck_hs_reset
new file mode 100644
index 000000000000..e6ce72e8c20d
--- /dev/null
+++ b/doc/ck_hs_reset
@@ -0,0 +1,77 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd September 17, 2012
+.Dt CK_HS_RESET 3
+.Sh NAME
+.Nm ck_hs_reset
+.Nd remove all keys from a hash set
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_hs.h
+.Ft bool
+.Fn ck_hs_reset "ck_hs_t *hs"
+.Sh DESCRIPTION
+The
+.Fn ck_hs_reset 3
+function will remove all keys stored in the hash
+set pointed to by the
+.Fa hs
+argument.
+.Sh RETURN VALUES
+If successful,
+.Fn ck_hs_reset 3
+will return true and will otherwise return false on failure. This
+function will only fail if a replacement hash set could not be
+allocated internally.
+.Sh ERRORS
+Behavior is undefined if
+.Fa hs
+is uninitialized. Behavior is
+undefined if this function is called by a non-writer
+thread.
+.Sh SEE ALSO
+.Xr ck_hs_init 3 ,
+.Xr ck_hs_move 3 ,
+.Xr ck_hs_destroy 3 ,
+.Xr CK_HS_HASH 3 ,
+.Xr ck_hs_iterator_init 3 ,
+.Xr ck_hs_next 3 ,
+.Xr ck_hs_get 3 ,
+.Xr ck_hs_put 3 ,
+.Xr ck_hs_put_unique 3 ,
+.Xr ck_hs_set 3 ,
+.Xr ck_hs_fas 3 ,
+.Xr ck_hs_remove 3 ,
+.Xr ck_hs_reset_size 3 ,
+.Xr ck_hs_grow 3 ,
+.Xr ck_hs_gc 3 ,
+.Xr ck_hs_rebuild 3 ,
+.Xr ck_hs_count 3 ,
+.Xr ck_hs_stat 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_hs_reset_size b/doc/ck_hs_reset_size
new file mode 100644
index 000000000000..801c0638ec19
--- /dev/null
+++ b/doc/ck_hs_reset_size
@@ -0,0 +1,80 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd May 5, 2013
+.Dt CK_HS_RESET_SIZE 3
+.Sh NAME
+.Nm ck_hs_reset_size
+.Nd remove all keys from a hash set
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_hs.h
+.Ft bool
+.Fn ck_hs_reset_size "ck_hs_t *hs" "unsigned long size"
+.Sh DESCRIPTION
+The
+.Fn ck_hs_reset_size 3
+function will remove all keys stored in the hash
+set pointed to by the
+.Fa hs
+argument and create a new generation of the hash set that
+is preallocated for
+.Fa size
+entries.
+.Sh RETURN VALUES
+If successful,
+.Fn ck_hs_reset_size 3
+will return true and will otherwise return false on failure. This
+function will only fail if a replacement hash set could not be
+allocated internally.
+.Sh ERRORS
+Behavior is undefined if
+.Fa hs
+is uninitialized. Behavior is
+undefined if this function is called by a non-writer
+thread.
+.Sh SEE ALSO
+.Xr ck_hs_init 3 ,
+.Xr ck_hs_move 3 ,
+.Xr ck_hs_destroy 3 ,
+.Xr CK_HS_HASH 3 ,
+.Xr ck_hs_iterator_init 3 ,
+.Xr ck_hs_next 3 ,
+.Xr ck_hs_get 3 ,
+.Xr ck_hs_put 3 ,
+.Xr ck_hs_put_unique 3 ,
+.Xr ck_hs_set 3 ,
+.Xr ck_hs_fas 3 ,
+.Xr ck_hs_remove 3 ,
+.Xr ck_hs_grow 3 ,
+.Xr ck_hs_gc 3 ,
+.Xr ck_hs_rebuild 3 ,
+.Xr ck_hs_count 3 ,
+.Xr ck_hs_reset 3 ,
+.Xr ck_hs_stat 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_hs_set b/doc/ck_hs_set
new file mode 100644
index 000000000000..e9ba9f1035d8
--- /dev/null
+++ b/doc/ck_hs_set
@@ -0,0 +1,102 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd September 17, 2012
+.Dt CK_HS_SET 3
+.Sh NAME
+.Nm ck_hs_set
+.Nd store key into a hash set
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_hs.h
+.Ft bool
+.Fn ck_hs_set "ck_hs_t *hs" "unsigned long hash" "const void *key" "void **previous"
+.Sh DESCRIPTION
+The
+.Fn ck_hs_set 3
+function will store the key specified by the
+.Fa key
+argument in the hash set pointed to by the
+.Fa hs
+argument. The key specified by
+.Fa key
+is expected to have the hash value specified by the
+.Fa hash
+argument (which was previously generated using the
+.Xr CK_HS_HASH 3
+macro).
+.Pp
+If the call to
+.Fn ck_hs_set 3
+was successful then the key specified by
+.Fa key
+was successfully stored in the hash set pointed to by
+.Fa hs .
+If the key already exists in the hash set, then it is
+replaced by
+.Fa key
+and the previous value is stored into the void pointer
+pointed to by the
+.Fa previous
+argument. If previous is set to
+.Dv NULL
+then
+.Fa key
+was not a replacement for an existing entry in the hash set.
+.Sh RETURN VALUES
+Upon successful completion,
+.Fn ck_hs_set 3
+returns true and otherwise returns false on failure.
+.Sh ERRORS
+Behavior is undefined if
+.Fa key
+or
+.Fa hs
+are uninitialized. The function will also
+return false if the hash set could not be enlarged
+to accomodate key insertion.
+.Sh SEE ALSO
+.Xr ck_hs_init 3 ,
+.Xr ck_hs_move 3 ,
+.Xr ck_hs_destroy 3 ,
+.Xr CK_HS_HASH 3 ,
+.Xr ck_hs_iterator_init 3 ,
+.Xr ck_hs_next 3 ,
+.Xr ck_hs_get 3 ,
+.Xr ck_hs_put 3 ,
+.Xr ck_hs_put_unique 3 ,
+.Xr ck_hs_fas 3 ,
+.Xr ck_hs_remove 3 ,
+.Xr ck_hs_grow 3 ,
+.Xr ck_hs_gc 3 ,
+.Xr ck_hs_rebuild 3 ,
+.Xr ck_hs_count 3 ,
+.Xr ck_hs_reset 3 ,
+.Xr ck_hs_reset_size 3 ,
+.Xr ck_hs_stat 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_hs_stat b/doc/ck_hs_stat
new file mode 100644
index 000000000000..796a89446b66
--- /dev/null
+++ b/doc/ck_hs_stat
@@ -0,0 +1,81 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd September 17, 2012
+.Dt CK_HS_STAT 3
+.Sh NAME
+.Nm ck_hs_stat
+.Nd get hash set status
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_hs.h
+.Ft void
+.Fn ck_hs_stat "ck_hs_t *hs" "struct ck_hs_stat *st"
+.Sh DESCRIPTION
+The
+.Fn ck_hs_stat 3
+function will store various hash set statistics in
+the object pointed to by
+.Fa st .
+The ck_hs_stat structure is defined as follows:
+.Bd -literal -offset indent
+struct ck_hs_stat {
+ unsigned long tombstones; /* Current number of tombstones in hash set. */
+ unsigned long n_entries; /* Current number of keys in hash set. */
+ unsigned int probe_maximum; /* Longest read-side probe sequence. */
+};
+.Ed
+.Sh RETURN VALUES
+.Fn ck_hs_stat 3
+has no return value.
+.Sh ERRORS
+Behavior is undefined if
+.Fa hs
+is uninitialized. Behavior is
+undefined if this function is called by a non-writer
+thread.
+.Sh SEE ALSO
+.Xr ck_hs_init 3 ,
+.Xr ck_hs_move 3 ,
+.Xr ck_hs_destroy 3 ,
+.Xr CK_HS_HASH 3 ,
+.Xr ck_hs_iterator_init 3 ,
+.Xr ck_hs_next 3 ,
+.Xr ck_hs_get 3 ,
+.Xr ck_hs_put 3 ,
+.Xr ck_hs_put_unique 3 ,
+.Xr ck_hs_set 3 ,
+.Xr ck_hs_fas 3 ,
+.Xr ck_hs_remove 3 ,
+.Xr ck_hs_grow 3 ,
+.Xr ck_hs_gc 3 ,
+.Xr ck_hs_rebuild 3 ,
+.Xr ck_hs_count 3 ,
+.Xr ck_hs_reset 3 ,
+.Xr ck_hs_reset_size 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_ht_count b/doc/ck_ht_count
new file mode 100644
index 000000000000..ba10835fa208
--- /dev/null
+++ b/doc/ck_ht_count
@@ -0,0 +1,77 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd March 29, 2012
+.Dt CK_HT_COUNT 3
+.Sh NAME
+.Nm ck_ht_count
+.Nd return count of key-value pairs in hash table
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_ht.h
+.Ft uint64_t
+.Fn ck_ht_count "ck_ht_t *ht"
+.Sh DESCRIPTION
+The
+.Fn ck_ht_count
+function will return the number of entries in the hash table
+pointed to be the
+.Fa ht
+argument. The function may only be called without the presence
+of concurrent write operations.
+.Sh ERRORS
+Behavior is undefined if
+.Fa ht
+has not been initialized.
+.Sh SEE ALSO
+.Xr ck_ht_stat 3 ,
+.Xr ck_ht_init 3 ,
+.Xr ck_ht_destroy 3 ,
+.Xr ck_ht_hash 3 ,
+.Xr ck_ht_hash_direct 3 ,
+.Xr ck_ht_set_spmc 3 ,
+.Xr ck_ht_put_spmc 3 ,
+.Xr ck_ht_gc 3 ,
+.Xr ck_ht_get_spmc 3 ,
+.Xr ck_ht_grow_spmc 3 ,
+.Xr ck_ht_remove_spmc 3 ,
+.Xr ck_ht_reset_size_spmc 3 ,
+.Xr ck_ht_reset_spmc 3 ,
+.Xr ck_ht_entry_empty 3 ,
+.Xr ck_ht_entry_key_set 3 ,
+.Xr ck_ht_entry_key_set_direct 3 ,
+.Xr ck_ht_entry_key 3 ,
+.Xr ck_ht_entry_key_length 3 ,
+.Xr ck_ht_entry_value 3 ,
+.Xr ck_ht_entry_set 3 ,
+.Xr ck_ht_entry_set_direct 3 ,
+.Xr ck_ht_entry_key_direct 3 ,
+.Xr ck_ht_entry_value_direct 3 ,
+.Xr ck_ht_iterator_init 3 ,
+.Xr ck_ht_next 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_ht_destroy b/doc/ck_ht_destroy
new file mode 100644
index 000000000000..95e4acb2fe6e
--- /dev/null
+++ b/doc/ck_ht_destroy
@@ -0,0 +1,87 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd March 29, 2012
+.Dt CK_HT_DESTROY 3
+.Sh NAME
+.Nm ck_ht_destroy
+.Nd immediately destroy a hash table
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_ht.h
+.Ft void
+.Fn ck_ht_destroy "ck_ht_t *ht"
+.Sh DESCRIPTION
+The
+.Fn ck_ht_destroy
+function will request that the underlying allocator, as specified by the
+.Xr ck_ht_init 3
+function, immediately destroy the object pointed to by the
+.Fa ht
+argument.
+.Pp
+The user must guarantee that no threads are accessing the object pointed to
+by
+.Fa ht
+when
+.Fn ck_ht_destroy
+is called.
+.Sh RETURN VALUES
+.Fn ck_ht_destroy
+has no return value.
+.Sh ERRORS
+.Bl -tag -width Er
+This function is guaranteed not to fail.
+.El
+.Sh SEE ALSO
+.Xr ck_ht_stat 3 ,
+.Xr ck_ht_init 3 ,
+.Xr ck_ht_hash 3 ,
+.Xr ck_ht_hash_direct 3 ,
+.Xr ck_ht_set_spmc 3 ,
+.Xr ck_ht_put_spmc 3 ,
+.Xr ck_ht_gc 3 ,
+.Xr ck_ht_get_spmc 3 ,
+.Xr ck_ht_grow_spmc 3 ,
+.Xr ck_ht_remove_spmc 3 ,
+.Xr ck_ht_reset_spmc 3 ,
+.Xr ck_ht_reset_size_spmc 3 ,
+.Xr ck_ht_count 3 ,
+.Xr ck_ht_entry_empty 3 ,
+.Xr ck_ht_entry_key_set 3 ,
+.Xr ck_ht_entry_key_set_direct 3 ,
+.Xr ck_ht_entry_key 3 ,
+.Xr ck_ht_entry_key_length 3 ,
+.Xr ck_ht_entry_value 3 ,
+.Xr ck_ht_entry_set 3 ,
+.Xr ck_ht_entry_set_direct 3 ,
+.Xr ck_ht_entry_key_direct 3 ,
+.Xr ck_ht_entry_value_direct 3 ,
+.Xr ck_ht_iterator_init 3 ,
+.Xr ck_ht_next 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_ht_entry_empty b/doc/ck_ht_entry_empty
new file mode 100644
index 000000000000..92333442763b
--- /dev/null
+++ b/doc/ck_ht_entry_empty
@@ -0,0 +1,90 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd March 29, 2012
+.Dt CK_HT_ENTRY_EMPTY 3
+.Sh NAME
+.Nm ck_ht_entry_empty
+.Nd determine whether entry contains a key-value pair
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_ht.h
+.Ft bool
+.Fn ck_ht_entry_empty "ck_ht_entry_t *entry"
+.Sh DESCRIPTION
+The
+.Fn ck_ht_entry_empty
+function will return
+.Dv false
+if
+.Fa entry
+points to a valid key-value pair. If
+.Fa entry
+does not point to a valid key-value pair it
+returns
+.Dv true.
+It is expected that the object pointed to by
+.Fa entry
+was initialized by a preceding call to the
+.Xr ck_ht_entry_set
+family of functions, the
+.Xr ck_ht_get_spmc 3
+function or the
+.Xr ck_ht_set_spmc 3
+function.
+.Sh ERRORS
+Behavior is undefined if
+.Fa entry
+has not been initialized.
+.Sh SEE ALSO
+.Xr ck_ht_stat 3 ,
+.Xr ck_ht_init 3 ,
+.Xr ck_ht_destroy 3 ,
+.Xr ck_ht_hash 3 ,
+.Xr ck_ht_hash_direct 3 ,
+.Xr ck_ht_set_spmc 3 ,
+.Xr ck_ht_put_spmc 3 ,
+.Xr ck_ht_gc 3 ,
+.Xr ck_ht_get_spmc 3 ,
+.Xr ck_ht_grow_spmc 3 ,
+.Xr ck_ht_remove_spmc 3 ,
+.Xr ck_ht_count 3 ,
+.Xr ck_ht_reset_spmc 3 ,
+.Xr ck_ht_reset_size_spmc 3 ,
+.Xr ck_ht_entry_key_set 3 ,
+.Xr ck_ht_entry_key_set_direct 3 ,
+.Xr ck_ht_entry_key 3 ,
+.Xr ck_ht_entry_key_length 3 ,
+.Xr ck_ht_entry_value 3 ,
+.Xr ck_ht_entry_set 3 ,
+.Xr ck_ht_entry_set_direct 3 ,
+.Xr ck_ht_entry_key_direct 3 ,
+.Xr ck_ht_entry_value_direct 3 ,
+.Xr ck_ht_iterator_init 3 ,
+.Xr ck_ht_next 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_ht_entry_key b/doc/ck_ht_entry_key
new file mode 100644
index 000000000000..5003a1a38df6
--- /dev/null
+++ b/doc/ck_ht_entry_key
@@ -0,0 +1,88 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd March 30, 2012
+.Dt CK_HT_ENTRY_KEY 3
+.Sh NAME
+.Nm ck_ht_entry_key
+.Nd return pointer to key as specified in hash table entry
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_ht.h
+.Ft void *
+.Fn ck_ht_entry_key "ck_ht_entry_t *entry"
+.Sh DESCRIPTION
+The
+.Fn ck_ht_entry_key
+function will return the key pointer as specified in the
+object pointed to by the
+.Fa entry
+argument.
+.Pp
+It is expected that the entry is
+associated with a hash table initialized with
+.Dv CK_HT_MODE_BYTESTRING
+(see
+.Xr ck_ht_init 3
+for more information).
+.Sh RETURN VALUES
+.Fn ck_ht_entry_key
+returns
+.Dv NULL
+if the entry is empty.
+.Sh ERRORS
+Behavior is undefined if
+.Fa entry
+has not been initialized.
+.Sh SEE ALSO
+.Xr ck_ht_stat 3 ,
+.Xr ck_ht_init 3 ,
+.Xr ck_ht_destroy 3 ,
+.Xr ck_ht_hash 3 ,
+.Xr ck_ht_hash_direct 3 ,
+.Xr ck_ht_set_spmc 3 ,
+.Xr ck_ht_put_spmc 3 ,
+.Xr ck_ht_gc 3 ,
+.Xr ck_ht_get_spmc 3 ,
+.Xr ck_ht_grow_spmc 3 ,
+.Xr ck_ht_remove_spmc 3 ,
+.Xr ck_ht_count 3 ,
+.Xr ck_ht_reset_spmc 3 ,
+.Xr ck_ht_reset_size_spmc 3 ,
+.Xr ck_ht_entry_empty 3 ,
+.Xr ck_ht_entry_key_set 3 ,
+.Xr ck_ht_entry_key_set_direct 3 ,
+.Xr ck_ht_entry_key_length 3 ,
+.Xr ck_ht_entry_value 3 ,
+.Xr ck_ht_entry_set 3 ,
+.Xr ck_ht_entry_set_direct 3 ,
+.Xr ck_ht_entry_key_direct 3 ,
+.Xr ck_ht_entry_value_direct 3 ,
+.Xr ck_ht_iterator_init 3 ,
+.Xr ck_ht_next 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_ht_entry_key_direct b/doc/ck_ht_entry_key_direct
new file mode 100644
index 000000000000..e0a75a2bb1b4
--- /dev/null
+++ b/doc/ck_ht_entry_key_direct
@@ -0,0 +1,91 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd March 30, 2012
+.Dt CK_HT_ENTRY_KEY_DIRECT 3
+.Sh NAME
+.Nm ck_ht_entry_key_direct
+.Nd return key value as specified in hash table entry
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_ht.h
+.Ft uintptr_t
+.Fn ck_ht_entry_key_direct "ck_ht_entry_t *entry"
+.Sh DESCRIPTION
+The
+.Fn ck_ht_entry_key_direct
+function will return the key value as specified in the
+object pointed to by the
+.Fa entry
+argument.
+.Pp
+It is expected that the entry is
+associated with a hash table initialized with
+.Dv CK_HT_MODE_DIRECT
+(see
+.Xr ck_ht_init 3
+for more information).
+.Sh RETURN VALUES
+.Fn ck_ht_entry_key_direct
+returns
+.Dv 0
+if the entry is empty. Otherwise, it returns the
+key value stored in the object pointed to by the
+.Fa entry
+argument.
+.Sh ERRORS
+Behavior is undefined if
+.Fa entry
+has not been initialized.
+.Sh SEE ALSO
+.Xr ck_ht_stat 3 ,
+.Xr ck_ht_init 3 ,
+.Xr ck_ht_destroy 3 ,
+.Xr ck_ht_hash 3 ,
+.Xr ck_ht_hash_direct 3 ,
+.Xr ck_ht_set_spmc 3 ,
+.Xr ck_ht_put_spmc 3 ,
+.Xr ck_ht_gc 3 ,
+.Xr ck_ht_get_spmc 3 ,
+.Xr ck_ht_grow_spmc 3 ,
+.Xr ck_ht_remove_spmc 3 ,
+.Xr ck_ht_count 3 ,
+.Xr ck_ht_reset_spmc 3 ,
+.Xr ck_ht_reset_size_spmc 3 ,
+.Xr ck_ht_entry_empty 3 ,
+.Xr ck_ht_entry_key_set 3 ,
+.Xr ck_ht_entry_key_set_direct 3 ,
+.Xr ck_ht_entry_key_length 3 ,
+.Xr ck_ht_entry_value 3 ,
+.Xr ck_ht_entry_set 3 ,
+.Xr ck_ht_entry_set_direct 3 ,
+.Xr ck_ht_entry_key 3 ,
+.Xr ck_ht_entry_value_direct 3 ,
+.Xr ck_ht_iterator_init 3 ,
+.Xr ck_ht_next 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_ht_entry_key_length b/doc/ck_ht_entry_key_length
new file mode 100644
index 000000000000..6ac3ded08f47
--- /dev/null
+++ b/doc/ck_ht_entry_key_length
@@ -0,0 +1,88 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd March 30, 2012
+.Dt CK_HT_ENTRY_KEY_LENGTH 3
+.Sh NAME
+.Nm ck_ht_entry_key_length
+.Nd returns the length of the key specified in the argument
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_ht.h
+.Ft uint16_t
+.Fn ck_ht_entry_key_length "ck_ht_entry_t *entry"
+.Sh DESCRIPTION
+The
+.Fn ck_ht_entry_key_length
+function will return the length of the key associated with the
+object pointed to by the
+.Fa entry
+argument.
+.Pp
+It is expected that the entry is
+associated with a hash table initialized with
+.Dv CK_HT_MODE_BYTESTRING
+(see
+.Xr ck_ht_init 3
+for more information).
+.Sh RETURN VALUES
+.Fn ck_ht_entry_key_length
+returns
+.Dv 0
+if the entry is empty.
+.Sh ERRORS
+Behavior is undefined if
+.Fa entry
+has not been initialized.
+.Sh SEE ALSO
+.Xr ck_ht_stat 3 ,
+.Xr ck_ht_init 3 ,
+.Xr ck_ht_destroy 3 ,
+.Xr ck_ht_hash 3 ,
+.Xr ck_ht_hash_direct 3 ,
+.Xr ck_ht_set_spmc 3 ,
+.Xr ck_ht_put_spmc 3 ,
+.Xr ck_ht_gc 3 ,
+.Xr ck_ht_get_spmc 3 ,
+.Xr ck_ht_grow_spmc 3 ,
+.Xr ck_ht_remove_spmc 3 ,
+.Xr ck_ht_count 3 ,
+.Xr ck_ht_reset_spmc 3 ,
+.Xr ck_ht_reset_size_spmc 3 ,
+.Xr ck_ht_entry_empty 3 ,
+.Xr ck_ht_entry_key_set 3 ,
+.Xr ck_ht_entry_key_set_direct 3 ,
+.Xr ck_ht_entry_key 3 ,
+.Xr ck_ht_entry_value 3 ,
+.Xr ck_ht_entry_set 3 ,
+.Xr ck_ht_entry_set_direct 3 ,
+.Xr ck_ht_entry_key_direct 3 ,
+.Xr ck_ht_entry_value_direct 3 ,
+.Xr ck_ht_iterator_init 3 ,
+.Xr ck_ht_next 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_ht_entry_key_set b/doc/ck_ht_entry_key_set
new file mode 100644
index 000000000000..03e53bb32e9e
--- /dev/null
+++ b/doc/ck_ht_entry_key_set
@@ -0,0 +1,93 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd March 30, 2012
+.Dt CK_HT_ENTRY_KEY_SET 3
+.Sh NAME
+.Nm ck_ht_entry_key_set
+.Nd initialize pointer to key in hash table entry
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_ht.h
+.Ft void
+.Fn ck_ht_entry_key_set "ck_ht_entry_t *entry" "const void *key" "uint16_t key_length"
+.Sh DESCRIPTION
+The
+.Fn ck_ht_entry_key_set
+function will initialize the object pointed to by
+.Fa entry
+with a key pointed to by the
+.Fa key
+argument. The length of the key is specified by
+.Fa key_length.
+The maximum value of
+.Fa key_length
+is defined by the CK_HT_KEY_LENGTH macro.
+This function is typically used to initialize an
+entry for
+.Xr ck_ht_get_spmc 3
+and
+.Xr ck_ht_remove_spmc 3
+operations. It is expected that the entry will
+be associated with a hash table initialized with
+.Dv CK_HT_MODE_BYTESTRING
+(see
+.Xr ck_ht_init 3
+for more information).
+.Sh RETURN VALUES
+.Fn ck_ht_entry_key_set
+has no return value.
+.Sh ERRORS
+This function will never fail.
+.Sh SEE ALSO
+.Xr ck_ht_stat 3 ,
+.Xr ck_ht_init 3 ,
+.Xr ck_ht_destroy 3 ,
+.Xr ck_ht_hash 3 ,
+.Xr ck_ht_hash_direct 3 ,
+.Xr ck_ht_set_spmc 3 ,
+.Xr ck_ht_put_spmc 3 ,
+.Xr ck_ht_gc 3 ,
+.Xr ck_ht_get_spmc 3 ,
+.Xr ck_ht_grow_spmc 3 ,
+.Xr ck_ht_remove_spmc 3 ,
+.Xr ck_ht_count 3 ,
+.Xr ck_ht_reset_spmc 3 ,
+.Xr ck_ht_reset_size_spmc 3 ,
+.Xr ck_ht_entry_empty 3 ,
+.Xr ck_ht_entry_key_set_direct 3 ,
+.Xr ck_ht_entry_key 3 ,
+.Xr ck_ht_entry_key_length 3 ,
+.Xr ck_ht_entry_value 3 ,
+.Xr ck_ht_entry_set 3 ,
+.Xr ck_ht_entry_set_direct 3 ,
+.Xr ck_ht_entry_key_direct 3 ,
+.Xr ck_ht_entry_value_direct 3 ,
+.Xr ck_ht_iterator_init 3 ,
+.Xr ck_ht_next 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_ht_entry_key_set_direct b/doc/ck_ht_entry_key_set_direct
new file mode 100644
index 000000000000..1cd2d6c2aa87
--- /dev/null
+++ b/doc/ck_ht_entry_key_set_direct
@@ -0,0 +1,88 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd March 30, 2012
+.Dt CK_HT_ENTRY_KEY_SET_DIRECT 3
+.Sh NAME
+.Nm ck_ht_entry_key_set_direct
+.Nd initialize key value in hash table entry
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_ht.h
+.Ft void
+.Fn ck_ht_entry_key_set_direct "ck_ht_entry_t *entry" "uintptr_t key"
+.Sh DESCRIPTION
+The
+.Fn ck_ht_entry_key_set_direct
+function will initialize the object pointed to by
+.Fa entry
+with the key value specified in the
+.Fa key
+argument. This function is typically used to initialize an
+entry for
+.Xr ck_ht_get_spmc 3
+and
+.Xr ck_ht_remove_spmc 3
+operations. It is expected that the entry will
+be associated with a hash table initialized with
+.Dv CK_HT_MODE_DIRECT
+(see
+.Xr ck_ht_init 3
+for more information).
+.Sh RETURN VALUES
+.Fn ck_ht_entry_key_set_direct
+has no return value.
+.Sh ERRORS
+This function will never fail.
+.Sh SEE ALSO
+.Xr ck_ht_stat 3 ,
+.Xr ck_ht_init 3 ,
+.Xr ck_ht_destroy 3 ,
+.Xr ck_ht_hash 3 ,
+.Xr ck_ht_hash_direct 3 ,
+.Xr ck_ht_set_spmc 3 ,
+.Xr ck_ht_put_spmc 3 ,
+.Xr ck_ht_gc 3 ,
+.Xr ck_ht_get_spmc 3 ,
+.Xr ck_ht_grow_spmc 3 ,
+.Xr ck_ht_remove_spmc 3 ,
+.Xr ck_ht_count 3 ,
+.Xr ck_ht_reset_spmc 3 ,
+.Xr ck_ht_reset_size_spmc 3 ,
+.Xr ck_ht_entry_empty 3 ,
+.Xr ck_ht_entry_key_set 3 ,
+.Xr ck_ht_entry_key 3 ,
+.Xr ck_ht_entry_key_length 3 ,
+.Xr ck_ht_entry_value 3 ,
+.Xr ck_ht_entry_set 3 ,
+.Xr ck_ht_entry_set_direct 3 ,
+.Xr ck_ht_entry_key_direct 3 ,
+.Xr ck_ht_entry_value_direct 3 ,
+.Xr ck_ht_iterator_init 3 ,
+.Xr ck_ht_next 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_ht_entry_set b/doc/ck_ht_entry_set
new file mode 100644
index 000000000000..b0174308a441
--- /dev/null
+++ b/doc/ck_ht_entry_set
@@ -0,0 +1,95 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd March 30, 2012
+.Dt CK_HT_ENTRY_SET 3
+.Sh NAME
+.Nm ck_ht_entry_set
+.Nd initialize a key-value pair
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_ht.h
+.Ft void
+.Fn ck_ht_entry_set "ck_ht_entry_t *entry" "ck_ht_hash_t h" "const void *key" "uint16_t key_length" "const void *value"
+.Sh DESCRIPTION
+The
+.Fn ck_ht_entry_set
+function will initialize the object pointed to by
+.Fa entry
+with a key pointed to by the
+.Fa key
+argument and a value pointed to by the
+.Fa value
+argument. The length of the key is specified by
+.Fa key_length.
+The maximum value of
+.Fa key_length
+is defined by the CK_HT_KEY_LENGTH macro.
+This function is typically used to initialize an
+entry for
+.Xr ck_ht_set_spmc 3
+and
+.Xr ck_ht_put_spmc 3
+operations. It is expected that the entry will
+be associated with a hash table initialized with
+.Dv CK_HT_MODE_BYTESTRING
+(see
+.Xr ck_ht_init 3
+for more information).
+.Sh RETURN VALUES
+.Fn ck_ht_entry_set
+has no return value.
+.Sh ERRORS
+This function will never fail.
+.Sh SEE ALSO
+.Xr ck_ht_stat 3 ,
+.Xr ck_ht_init 3 ,
+.Xr ck_ht_destroy 3 ,
+.Xr ck_ht_hash 3 ,
+.Xr ck_ht_hash_direct 3 ,
+.Xr ck_ht_set_spmc 3 ,
+.Xr ck_ht_put_spmc 3 ,
+.Xr ck_ht_gc 3 ,
+.Xr ck_ht_get_spmc 3 ,
+.Xr ck_ht_grow_spmc 3 ,
+.Xr ck_ht_remove_spmc 3 ,
+.Xr ck_ht_count 3 ,
+.Xr ck_ht_reset_spmc 3 ,
+.Xr ck_ht_reset_size_spmc 3 ,
+.Xr ck_ht_entry_empty 3 ,
+.Xr ck_ht_entry_set_direct 3 ,
+.Xr ck_ht_entry_key 3 ,
+.Xr ck_ht_entry_key_length 3 ,
+.Xr ck_ht_entry_value 3 ,
+.Xr ck_ht_entry_key_set 3 ,
+.Xr ck_ht_entry_key_set_direct 3 ,
+.Xr ck_ht_entry_key_direct 3 ,
+.Xr ck_ht_entry_value_direct 3 ,
+.Xr ck_ht_iterator_init 3 ,
+.Xr ck_ht_next 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_ht_entry_set_direct b/doc/ck_ht_entry_set_direct
new file mode 100644
index 000000000000..9c9bf0873ea5
--- /dev/null
+++ b/doc/ck_ht_entry_set_direct
@@ -0,0 +1,94 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd March 30, 2012
+.Dt CK_HT_ENTRY_SET_DIRECT 3
+.Sh NAME
+.Nm ck_ht_entry_set_direct
+.Nd initialize a key-value pair
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_ht.h
+.Ft void
+.Fn ck_ht_entry_set_direct "ck_ht_entry_t *entry" "ck_ht_hash_t h" "uintptr_t key" "uintptr_t value"
+.Sh DESCRIPTION
+The
+.Fn ck_ht_entry_set
+function will initialize the object pointed to by
+.Fa entry
+with the hash value specified by the
+.Fa h
+argument, the key value specified in the
+.Fa key
+argument and the value specified by the
+.Fa value
+argument.
+.Pp
+This function is typically used to initialize an
+entry for
+.Xr ck_ht_set_spmc 3
+and
+.Xr ck_ht_put_spmc 3
+operations. It is expected that the entry will
+be associated with a hash table initialized with
+.Dv CK_HT_MODE_DIRECT
+(see
+.Xr ck_ht_init 3
+for more information).
+.Sh RETURN VALUES
+.Fn ck_ht_entry_set_direct
+has no return value.
+.Sh ERRORS
+This function will never fail.
+.Sh SEE ALSO
+.Xr ck_ht_stat 3 ,
+.Xr ck_ht_init 3 ,
+.Xr ck_ht_destroy 3 ,
+.Xr ck_ht_hash 3 ,
+.Xr ck_ht_hash_direct 3 ,
+.Xr ck_ht_set_spmc 3 ,
+.Xr ck_ht_put_spmc 3 ,
+.Xr ck_ht_gc 3 ,
+.Xr ck_ht_get_spmc 3 ,
+.Xr ck_ht_grow_spmc 3 ,
+.Xr ck_ht_remove_spmc 3 ,
+.Xr ck_ht_count 3 ,
+.Xr ck_ht_reset_spmc 3 ,
+.Xr ck_ht_reset_size_spmc 3 ,
+.Xr ck_ht_entry_empty 3 ,
+.Xr ck_ht_entry_key 3 ,
+.Xr ck_ht_entry_key_length 3 ,
+.Xr ck_ht_entry_value 3 ,
+.Xr ck_ht_entry_key_set 3 ,
+.Xr ck_ht_entry_key_set_direct 3 ,
+.Xr ck_ht_entry_set 3 ,
+.Xr ck_ht_entry_key_direct 3 ,
+.Xr ck_ht_entry_value_direct 3 ,
+.Xr ck_ht_iterator_init 3 ,
+.Xr ck_ht_next 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_ht_entry_value b/doc/ck_ht_entry_value
new file mode 100644
index 000000000000..2e712e3b7bcc
--- /dev/null
+++ b/doc/ck_ht_entry_value
@@ -0,0 +1,88 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd March 30, 2012
+.Dt CK_HT_ENTRY_VALUE 3
+.Sh NAME
+.Nm ck_ht_entry_value
+.Nd return pointer to value as specified in hash table entry
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_ht.h
+.Ft void *
+.Fn ck_ht_entry_value "ck_ht_entry_t *entry"
+.Sh DESCRIPTION
+The
+.Fn ck_ht_entry_value
+function will return the value pointer as specified in the
+object pointed to by the
+.Fa entry
+argument.
+.Pp
+It is expected that the entry is
+associated with a hash table initialized with
+.Dv CK_HT_MODE_BYTESTRING
+(see
+.Xr ck_ht_init 3
+for more information).
+.Sh RETURN VALUES
+The
+.Fn ck_ht_entry_value
+function returns the value pointed to by
+.Dv entry.
+.Sh ERRORS
+Behavior is undefined if
+.Fa entry
+has not been initialized or if the key is empty.
+.Sh SEE ALSO
+.Xr ck_ht_stat 3 ,
+.Xr ck_ht_init 3 ,
+.Xr ck_ht_destroy 3 ,
+.Xr ck_ht_hash 3 ,
+.Xr ck_ht_hash_direct 3 ,
+.Xr ck_ht_set_spmc 3 ,
+.Xr ck_ht_put_spmc 3 ,
+.Xr ck_ht_gc 3 ,
+.Xr ck_ht_get_spmc 3 ,
+.Xr ck_ht_grow_spmc 3 ,
+.Xr ck_ht_remove_spmc 3 ,
+.Xr ck_ht_count 3 ,
+.Xr ck_ht_reset_spmc 3 ,
+.Xr ck_ht_reset_size_spmc 3 ,
+.Xr ck_ht_entry_empty 3 ,
+.Xr ck_ht_entry_key_set 3 ,
+.Xr ck_ht_entry_key_set_direct 3 ,
+.Xr ck_ht_entry_key_length 3 ,
+.Xr ck_ht_entry_key 3 ,
+.Xr ck_ht_entry_set 3 ,
+.Xr ck_ht_entry_set_direct 3 ,
+.Xr ck_ht_entry_key_direct 3 ,
+.Xr ck_ht_entry_value_direct 3 ,
+.Xr ck_ht_iterator_init 3 ,
+.Xr ck_ht_next 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_ht_entry_value_direct b/doc/ck_ht_entry_value_direct
new file mode 100644
index 000000000000..1a7c28e69104
--- /dev/null
+++ b/doc/ck_ht_entry_value_direct
@@ -0,0 +1,89 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd March 30, 2012
+.Dt CK_HT_ENTRY_VALUE_DIRECT 3
+.Sh NAME
+.Nm ck_ht_entry_value_direct
+.Nd return value as specified in hash table entry
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_ht.h
+.Ft uintptr_t
+.Fn ck_ht_entry_value_direct "ck_ht_entry_t *entry"
+.Sh DESCRIPTION
+The
+.Fn ck_ht_entry_value_direct
+function will return the value of the key-value pair as specified in the
+object pointed to by the
+.Fa entry
+argument.
+.Pp
+It is expected that the entry is
+associated with a hash table initialized with
+.Dv CK_HT_MODE_DIRECT
+(see
+.Xr ck_ht_init 3
+for more information).
+.Sh RETURN VALUES
+The
+.Fn ck_ht_entry_value_direct
+function returns the value stored in the object pointed to by the
+.Fa entry
+argument.
+.Sh ERRORS
+Behavior is undefined if
+.Fa entry
+has not been initialized or if the key is empty.
+.Sh SEE ALSO
+.Xr ck_ht_stat 3 ,
+.Xr ck_ht_init 3 ,
+.Xr ck_ht_destroy 3 ,
+.Xr ck_ht_hash 3 ,
+.Xr ck_ht_hash_direct 3 ,
+.Xr ck_ht_set_spmc 3 ,
+.Xr ck_ht_put_spmc 3 ,
+.Xr ck_ht_gc 3 ,
+.Xr ck_ht_get_spmc 3 ,
+.Xr ck_ht_grow_spmc 3 ,
+.Xr ck_ht_remove_spmc 3 ,
+.Xr ck_ht_count 3 ,
+.Xr ck_ht_reset_spmc 3 ,
+.Xr ck_ht_reset_size_spmc 3 ,
+.Xr ck_ht_entry_empty 3 ,
+.Xr ck_ht_entry_key_set 3 ,
+.Xr ck_ht_entry_key_set_direct 3 ,
+.Xr ck_ht_entry_key_length 3 ,
+.Xr ck_ht_entry_key 3 ,
+.Xr ck_ht_entry_set 3 ,
+.Xr ck_ht_entry_set_direct 3 ,
+.Xr ck_ht_entry_key_direct 3 ,
+.Xr ck_ht_entry_value 3 ,
+.Xr ck_ht_iterator_init 3 ,
+.Xr ck_ht_next 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_ht_gc b/doc/ck_ht_gc
new file mode 100644
index 000000000000..8bbad56a86fc
--- /dev/null
+++ b/doc/ck_ht_gc
@@ -0,0 +1,96 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd December 18, 2013
+.Dt CK_HT_GC 3
+.Sh NAME
+.Nm ck_ht_gc
+.Nd perform maintenance on a hash table
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_ht.h
+.Ft bool
+.Fn ck_ht_gc "ck_ht_t *ht" "unsigned long cycles" "unsigned long seed"
+.Sh DESCRIPTION
+The
+.Fn ck_ht_gc
+function will perform various maintenance routines on the hash table
+pointed to by
+.Fa ht ,
+including defragmentation of probe sequences with respect to tombstones
+and in the case that the delete workload hint has been passed, recalculation
+of probe sequence bounds. The
+.Fa cycles
+argument is used to indicate how many hash table entries should be subject
+to attempted maintenance.
+If
+.Fa cycles
+is 0, then maintenance is performed on the complete hash table. The
+.Fa seed
+argument determines the start location of the maintenance process. If
+.Fa cycles
+is non-zero, it is recommended that
+.Fa seed
+is some random value. If the delete hint has been passed, the function
+will require an additional 12% of memory (with respect to existing
+memory usage of the set), until operation completion.
+.Sh RETURN VALUES
+Upon successful completion,
+.Fn ck_ht_gc 3
+returns true and otherwise returns false on failure due to memory allocation
+failure.
+.Sh ERRORS
+This function will only return false if there are internal memory allocation
+failures.
+.Sh SEE ALSO
+.Xr ck_ht_count 3 ,
+.Xr ck_ht_stat 3 ,
+.Xr ck_ht_init 3 ,
+.Xr ck_ht_destroy 3 ,
+.Xr ck_ht_hash 3 ,
+.Xr ck_ht_hash_direct 3 ,
+.Xr ck_ht_set_spmc 3 ,
+.Xr ck_ht_put_spmc 3 ,
+.Xr ck_ht_get_spmc 3 ,
+.Xr ck_ht_grow_spmc 3 ,
+.Xr ck_ht_remove_spmc 3 ,
+.Xr ck_ht_reset_size_spmc 3 ,
+.Xr ck_ht_reset_spmc 3 ,
+.Xr ck_ht_entry_empty 3 ,
+.Xr ck_ht_entry_key_set 3 ,
+.Xr ck_ht_entry_key_set_direct 3 ,
+.Xr ck_ht_entry_key 3 ,
+.Xr ck_ht_entry_key_length 3 ,
+.Xr ck_ht_entry_value 3 ,
+.Xr ck_ht_entry_set 3 ,
+.Xr ck_ht_entry_set_direct 3 ,
+.Xr ck_ht_entry_key_direct 3 ,
+.Xr ck_ht_entry_value_direct 3 ,
+.Xr ck_ht_iterator_init 3 ,
+.Xr ck_ht_next 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_ht_get_spmc b/doc/ck_ht_get_spmc
new file mode 100644
index 000000000000..91b95340ecc7
--- /dev/null
+++ b/doc/ck_ht_get_spmc
@@ -0,0 +1,177 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd March 29, 2012
+.Dt CK_HT_GET_SPMC 3
+.Sh NAME
+.Nm ck_ht_get_spmc
+.Nd load a key-value pair from a hash table
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_ht.h
+.Ft bool
+.Fn ck_ht_get_spmc "ck_ht_t *ht" "ck_ht_hash_t h" "ck_ht_entry_t *entry"
+.Sh DESCRIPTION
+The
+.Fn ck_ht_get_spmc
+function will return the value associated with the key specified in the
+.Fa entry
+argument in the hash table pointed to by the
+.Fa ht
+argument. The key specified in
+.Fa entry
+is expected to have the hash value specified by the
+.Fa h
+argument.
+.Pp
+If
+.Fa ht
+was created with CK_HT_MODE_BYTESTRING then
+.Fa entry
+must have been initialized with the
+.Xr ck_ht_entry_set_key 3
+or
+.Xr ck_ht_entry_set 3
+functions. If
+.Fa ht
+was created with CK_HT_MODE_DIRECT then
+.Fa entry
+must have been initialized with the
+.Xr ck_ht_entry_key_set_direct 3
+or
+.Xr ck_ht_entry_set_direct 3
+functions.
+.Pp
+It is expected that
+.Fa h
+was initialized with
+.Xr ck_ht_hash 3
+if
+.Fa ht
+was created with CK_HT_MODE_BYTESTRING. If
+.Fa ht
+was initialized with CK_HT_MODE_DIRECT then it is
+expected that
+.Fa h
+was initialized with the
+.Xr ck_ht_hash_direct 3
+function.
+.Pp
+If the call to
+.Fn ck_ht_get_spmc
+was successful then the key-value pair in
+.Fa entry
+was successfully found in the hash table pointed
+to by
+.Fa h
+and will fail if the key specified in
+.Fa entry
+does not exist in the hash table. If successful
+.Fa entry
+will contain the key-value pair found in the hash table
+pointed to by the
+.Fa ht
+argument.
+.Pp
+If
+.Fa ht
+was initialized with CK_HT_MODE_BYTESTRING then
+the key/value pair in
+.Fa entry
+may be extracted using the
+.Xr ck_ht_entry_key 3
+and
+.Xr ck_ht_entry_value 3
+functions. The length of the key may be extracted
+using the
+.Xr ck_ht_entry_key_length 3
+function.
+.Pp
+If
+.Fa ht
+was initialized with CK_HT_MODE_DIRECT then the
+key/value pair in
+.Fa entry
+may be extracted using the
+.Xr ck_ht_entry_key_direct 3
+and
+.Xr ck_ht_entry_value_direct 3
+functions.
+.Pp
+This function is safe to call in the presence of a concurrent writer.
+.Sh RETURN VALUES
+Upon successful completion
+.Fn ck_ht_get_spmc
+returns
+.Dv true.
+If successful,
+.Fa entry
+will contain the key/value pair as found
+in the hash table.
+Otherwise the function returns
+.Dv false
+on failure.
+.Sh ERRORS
+.Bl -tag -width Er
+Behavior is undefined if
+.Fa entry
+or
+.Fa ht
+are uninitialized. The function will return
+.Dv false
+if the key as specified in
+.Fa entry
+was not found in the hash table.
+.El
+.Sh SEE ALSO
+.Xr ck_ht_stat 3 ,
+.Xr ck_ht_init 3 ,
+.Xr ck_ht_destroy 3 ,
+.Xr ck_ht_hash 3 ,
+.Xr ck_ht_hash_direct 3 ,
+.Xr ck_ht_set_spmc 3 ,
+.Xr ck_ht_put_spmc 3 ,
+.Xr ck_ht_gc 3 ,
+.Xr ck_ht_grow_spmc 3 ,
+.Xr ck_ht_remove_spmc 3 ,
+.Xr ck_ht_reset_spmc 3 ,
+.Xr ck_ht_reset_size_spmc 3 ,
+.Xr ck_ht_count 3 ,
+.Xr ck_ht_entry_empty 3 ,
+.Xr ck_ht_entry_key_set 3 ,
+.Xr ck_ht_entry_key_set_direct 3 ,
+.Xr ck_ht_entry_key 3 ,
+.Xr ck_ht_entry_key_length 3 ,
+.Xr ck_ht_entry_value 3 ,
+.Xr ck_ht_entry_set 3 ,
+.Xr ck_ht_entry_set_direct 3 ,
+.Xr ck_ht_entry_key_direct 3 ,
+.Xr ck_ht_entry_value_direct 3 ,
+.Xr ck_ht_iterator_init 3 ,
+.Xr ck_ht_next 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_ht_grow_spmc b/doc/ck_ht_grow_spmc
new file mode 100644
index 000000000000..70e6055fde2c
--- /dev/null
+++ b/doc/ck_ht_grow_spmc
@@ -0,0 +1,98 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd March 29, 2012
+.Dt CK_HT_GROW_SPMC 3
+.Sh NAME
+.Nm ck_ht_grow_spmc
+.Nd resize a hash table if necessary
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_ht.h
+.Ft bool
+.Fn ck_ht_grow_spmc "ck_ht_t *ht" "uint64_t capacity"
+.Sh DESCRIPTION
+The
+.Fn ck_ht_grow_spmc
+function will resize the hash table in order to be able to
+at least store the number of entries specified by
+.Fa capacity
+at a load factor of one. The default load hash table load factor is
+0.5. If you wish to minimize the likelihood of memory allocations
+for a hash table meant to store n entries then specify a capacity
+of 2n. The default behavior of ck_ht is to round
+.Fa capacity
+to the next available power of two if it is not already a power
+of two.
+.Pp
+This function is safe to call in the presence of concurrent
+.Xr ck_ht_get_spmc 3
+operations.
+.Sh RETURN VALUES
+Upon successful completion
+.Fn ck_ht_grow_spmc
+returns
+.Dv true
+and otherwise returns a
+.Dv false
+value.
+.Sh ERRORS
+.Bl -tag -width Er
+Behavior is undefined if
+.Fa ht
+is uninitialized. The function will only return
+.Dv false
+if there are internal memory allocation failures.
+.El
+.Sh SEE ALSO
+.Xr ck_ht_stat 3 ,
+.Xr ck_ht_init 3 ,
+.Xr ck_ht_destroy 3 ,
+.Xr ck_ht_hash 3 ,
+.Xr ck_ht_hash_direct 3 ,
+.Xr ck_ht_set_spmc 3 ,
+.Xr ck_ht_put_spmc 3 ,
+.Xr ck_ht_gc 3 ,
+.Xr ck_ht_get_spmc 3 ,
+.Xr ck_ht_remove_spmc 3 ,
+.Xr ck_ht_reset_spmc 3 ,
+.Xr ck_ht_reset_size_spmc 3 ,
+.Xr ck_ht_count 3 ,
+.Xr ck_ht_entry_empty 3 ,
+.Xr ck_ht_entry_key_set 3 ,
+.Xr ck_ht_entry_key_set_direct 3 ,
+.Xr ck_ht_entry_key 3 ,
+.Xr ck_ht_entry_key_length 3 ,
+.Xr ck_ht_entry_value 3 ,
+.Xr ck_ht_entry_set 3 ,
+.Xr ck_ht_entry_set_direct 3 ,
+.Xr ck_ht_entry_key_direct 3 ,
+.Xr ck_ht_entry_value_direct 3 ,
+.Xr ck_ht_iterator_init 3 ,
+.Xr ck_ht_next 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_ht_hash b/doc/ck_ht_hash
new file mode 100644
index 000000000000..0ac5db9a8b08
--- /dev/null
+++ b/doc/ck_ht_hash
@@ -0,0 +1,90 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd March 29, 2012
+.Dt CK_HT_HASH 3
+.Sh NAME
+.Nm ck_ht_hash
+.Nd generate a hash value for a hash table
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_ht.h
+.Ft void
+.Fn ck_ht_hash "ck_ht_hash_t *h" "ck_ht_t *ht" "const void *key" "uint16_t key_length"
+.Sh DESCRIPTION
+The
+.Fn ck_ht_hash
+function will generate a hash value in the object pointed to by the
+.Fa h
+argument. The hash value is valid for use in the hash table pointed to by the
+.Fa ht
+argument for the key (of bytestring type) specified by the
+.Fa key
+argument. The length of the key is specified by the
+.Fa key_length
+argument.
+.Sh RETURN VALUES
+.Fn ck_ht_hash
+has no return value.
+.Sh ERRORS
+.Bl -tag -width Er
+Behavior is undefined if
+.Fa key
+is
+.Dv NULL
+or if
+.Fa ht
+is uninitialized.
+.El
+.Sh SEE ALSO
+.Xr ck_ht_stat 3 ,
+.Xr ck_ht_init 3 ,
+.Xr ck_ht_destroy 3 ,
+.Xr ck_ht_hash_direct 3 ,
+.Xr ck_ht_set_spmc 3 ,
+.Xr ck_ht_put_spmc 3 ,
+.Xr ck_ht_gc 3 ,
+.Xr ck_ht_get_spmc 3 ,
+.Xr ck_ht_grow_spmc 3 ,
+.Xr ck_ht_remove_spmc 3 ,
+.Xr ck_ht_reset_spmc 3 ,
+.Xr ck_ht_reset_size_spmc 3 ,
+.Xr ck_ht_count 3 ,
+.Xr ck_ht_entry_empty 3 ,
+.Xr ck_ht_entry_key_set 3 ,
+.Xr ck_ht_entry_key_set_direct 3 ,
+.Xr ck_ht_entry_key 3 ,
+.Xr ck_ht_entry_key_length 3 ,
+.Xr ck_ht_entry_value 3 ,
+.Xr ck_ht_entry_set 3 ,
+.Xr ck_ht_entry_set_direct 3 ,
+.Xr ck_ht_entry_key_direct 3 ,
+.Xr ck_ht_entry_value_direct 3 ,
+.Xr ck_ht_iterator_init 3 ,
+.Xr ck_ht_next 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_ht_hash_direct b/doc/ck_ht_hash_direct
new file mode 100644
index 000000000000..564099c12281
--- /dev/null
+++ b/doc/ck_ht_hash_direct
@@ -0,0 +1,90 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd March 29, 2012
+.Dt CK_HT_HASH_DIRECT 3
+.Sh NAME
+.Nm ck_ht_hash_direct
+.Nd generate a hash value for a hash table
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_ht.h
+.Ft void
+.Fn ck_ht_hash_direct "ck_ht_hash_t *h" "ck_ht_t *ht" "uintptr_t key"
+.Sh DESCRIPTION
+The
+.Fn ck_ht_hash_direct
+function will generate a hash value in the object pointed to by the
+.Fa h
+argument. The hash value is valid for use in the hash table pointed to by the
+.Fa ht
+argument for the key (of direct type) specified by the
+.Fa key
+argument.
+.Sh RETURN VALUES
+.Fn ck_ht_hash_direct
+has no return value.
+.Sh ERRORS
+.Bl -tag -width Er
+Behavior is undefined if
+.Fa key
+is a
+.Dv 0
+or
+.Dv UINTPTR_MAX
+value or if
+.Fa ht
+is uninitialized.
+.El
+.Sh SEE ALSO
+.Xr ck_ht_stat 3 ,
+.Xr ck_ht_init 3 ,
+.Xr ck_ht_destroy 3 ,
+.Xr ck_ht_hash 3 ,
+.Xr ck_ht_set_spmc 3 ,
+.Xr ck_ht_put_spmc 3 ,
+.Xr ck_ht_gc 3 ,
+.Xr ck_ht_get_spmc 3 ,
+.Xr ck_ht_grow_spmc 3 ,
+.Xr ck_ht_remove_spmc 3 ,
+.Xr ck_ht_reset_spmc 3 ,
+.Xr ck_ht_reset_size_spmc 3 ,
+.Xr ck_ht_count 3 ,
+.Xr ck_ht_entry_empty 3 ,
+.Xr ck_ht_entry_key_set 3 ,
+.Xr ck_ht_entry_key_set_direct 3 ,
+.Xr ck_ht_entry_key 3 ,
+.Xr ck_ht_entry_key_length 3 ,
+.Xr ck_ht_entry_value 3 ,
+.Xr ck_ht_entry_set 3 ,
+.Xr ck_ht_entry_set_direct 3 ,
+.Xr ck_ht_entry_key_direct 3 ,
+.Xr ck_ht_entry_value_direct 3 ,
+.Xr ck_ht_iterator_init 3 ,
+.Xr ck_ht_next 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_ht_init b/doc/ck_ht_init
new file mode 100644
index 000000000000..757a39ad0313
--- /dev/null
+++ b/doc/ck_ht_init
@@ -0,0 +1,188 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd March 28, 2012
+.Dt CK_HT_INIT 3
+.Sh NAME
+.Nm ck_ht_init
+.Nd initialize a hash table
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_ht.h
+.Ft typedef void
+.Fn ck_ht_hash_cb_t "ck_ht_hash_t *h" "const void *key" "size_t key_length" "uint64_t seed"
+.Ft bool
+.Fn ck_ht_init "ck_ht_t *ht" "enum ck_ht_mode mode" "ck_ht_hash_cb_t *hash_function" "struct ck_malloc *allocator" "uint64_t capacity" "uint64_t seed"
+.Sh DESCRIPTION
+The
+.Fn ck_ht_init
+function initializes the hash table pointed to by the
+.Fa ht
+pointer.
+.Pp
+The argument
+.Fa mode
+specifies the type of key-value pairs to be stored in the
+hash table. The value of
+.Fa mode
+may be one of:
+.Bl -tag -width indent
+.It CK_HT_MODE_BYTESTRING
+The hash table is meant to store key-value pointers where
+key is a region of memory that is up to 65536 bytes long.
+This pointer will be dereferenced during hash table operations
+for key comparison. Entries of this hash table are expected
+to be interacted with using the
+.Xr ck_ht_entry_empty 3 ,
+.Xr ck_ht_entry_key 3 ,
+.Xr ck_ht_entry_key_length 3 ,
+.Xr ck_ht_entry_value 3 ,
+and
+.Xr ck_ht_entry_set 3
+functions. Attempting a hash table operation with a key of value
+NULL or (void *)UINTPTR_MAX will result in undefined behavior.
+.It CK_HT_MODE_DIRECT
+The hash table is meant to store key-value pointers where
+the key is of fixed width field compatible with the
+.Tn uintptr_t
+type. The key will be directly compared with other keys for
+equality. Entries of this hash table are expected to be interacted
+with using the
+.Xr ck_ht_entry_empty 3 ,
+.Xr ck_ht_entry_key_direct 3 ,
+.Xr ck_ht_entry_value_direct 3
+and
+.Xr ck_ht_entry_set_direct 3
+functions. Attempting a hash table operation with a key of value of 0 or
+UINTPTR_MAX will result in undefined behavior.
+.El
+.Pp
+In addition to this, the user may bitwise OR the mode flag with
+CK_HT_WORKLOAD_DELETE to indicate that the hash table will
+have to handle a delete heavy workload, in which case stronger
+bounds on latency can be provided at the cost of approximately
+13% higher memory usage.
+The argument
+.Fa hash_function
+is a pointer to a user-specified hash function. It is optional,
+if
+.Dv NULL
+is specified, then the default hash function implementation will be
+used (
+.Xr ck_ht_hash 3 ).
+A user-specified hash function takes four arguments. The
+.Fa h
+argument is a pointer to a hash value object. The hash function
+is expected to update the
+.Fa value
+object of type
+.Fa uint64_t
+contained with-in the object pointed to by
+.Fa h .
+The
+.Fa key
+argument is a pointer to a key, the
+.Fa key_length
+argument is the length of the key and the
+.Fa seed
+argument is the initial seed associated with the hash table.
+This initial seed is specified by the user in
+.Xr ck_ht_init 3 .
+.Pp
+The
+.Fa allocator
+argument is a pointer to a structure containing
+.Fa malloc
+and
+.Fa free
+function pointers which respectively define the memory allocation and
+destruction functions to be used by the hash table being initialized.
+.Pp
+The argument
+.Fa capacity
+represents the initial number of key-value pairs the hash
+table is expected to contain. This argument is simply a hint
+and the underlying implementation is free to allocate more
+or less memory than necessary to contain the number of entries
+.Fa capacity
+specifies.
+.Pp
+The argument
+.Fa seed
+specifies the initial seed used by the underlying hash function.
+The user is free to choose a value of their choice.
+.Pp
+The hash table is safe to access by multiple readers in the presence
+of one concurrent writer. Behavior is undefined in the presence of
+concurrent writers.
+.Sh RETURN VALUES
+Upon successful completion
+.Fn ck_ht_init
+returns a value of
+.Dv true
+and otherwise returns a value of
+.Dv false
+to indicate an error.
+.Sh ERRORS
+.Bl -tag -width Er
+.Pp
+The behavior of
+.Fn ck_ht_init
+is undefined if
+.Fa ht
+is not a pointer to a
+.Tn ck_ht_t
+object.
+.El
+.Sh SEE ALSO
+.Xr ck_ht_stat 3 ,
+.Xr ck_ht_destroy 3 ,
+.Xr ck_ht_hash 3 ,
+.Xr ck_ht_hash_direct 3 ,
+.Xr ck_ht_set_spmc 3 ,
+.Xr ck_ht_put_spmc 3 ,
+.Xr ck_ht_gc 3 ,
+.Xr ck_ht_get_spmc 3 ,
+.Xr ck_ht_grow_spmc 3 ,
+.Xr ck_ht_remove_spmc 3 ,
+.Xr ck_ht_reset_spmc 3 ,
+.Xr ck_ht_reset_size_spmc 3 ,
+.Xr ck_ht_count 3 ,
+.Xr ck_ht_entry_empty 3 ,
+.Xr ck_ht_entry_key_set 3 ,
+.Xr ck_ht_entry_key_set_direct 3 ,
+.Xr ck_ht_entry_key 3 ,
+.Xr ck_ht_entry_key_length 3 ,
+.Xr ck_ht_entry_value 3 ,
+.Xr ck_ht_entry_set 3 ,
+.Xr ck_ht_entry_set_direct 3 ,
+.Xr ck_ht_entry_key_direct 3 ,
+.Xr ck_ht_entry_value_direct 3 ,
+.Xr ck_ht_iterator_init 3 ,
+.Xr ck_ht_next 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_ht_iterator_init b/doc/ck_ht_iterator_init
new file mode 100644
index 000000000000..14f10c6ec450
--- /dev/null
+++ b/doc/ck_ht_iterator_init
@@ -0,0 +1,88 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd March 30, 2012
+.Dt CK_HT_ITERATOR_INIT 3
+.Sh NAME
+.Nm ck_ht_iterator_init
+.Nd initialize hash table iterator
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_ht.h
+.Pp
+.Dv ck_ht_iterator_t iterator = CK_HT_ITERATOR_INITIALIZER
+.Pp
+.Ft void
+.Fn ck_ht_iterator_init "ck_ht_iterator_t *iterator"
+.Sh DESCRIPTION
+The
+.Fn ck_ht_iterator_init
+function will initialize the object pointed to by
+the
+.Fa iterator
+argument. Alternatively, an iterator may be statically initialized
+by assigning it the
+.Dv CK_HT_ITERATOR_INITIALIZER
+value.
+.Pp
+An iterator is used to iterate through hash table entries
+with the
+.Xr ck_ht_next 3
+function.
+.Sh RETURN VALUES
+The
+.Fn ck_ht_iterator_init
+function does not return a value.
+.Sh ERRORS
+This function will not fail.
+.Sh SEE ALSO
+.Xr ck_ht_stat 3 ,
+.Xr ck_ht_init 3 ,
+.Xr ck_ht_destroy 3 ,
+.Xr ck_ht_hash 3 ,
+.Xr ck_ht_hash_direct 3 ,
+.Xr ck_ht_set_spmc 3 ,
+.Xr ck_ht_put_spmc 3 ,
+.Xr ck_ht_gc 3 ,
+.Xr ck_ht_get_spmc 3 ,
+.Xr ck_ht_grow_spmc 3 ,
+.Xr ck_ht_remove_spmc 3 ,
+.Xr ck_ht_count 3 ,
+.Xr ck_ht_reset_size_spmc 3 ,
+.Xr ck_ht_entry_empty 3 ,
+.Xr ck_ht_entry_key_set 3 ,
+.Xr ck_ht_entry_key_set_direct 3 ,
+.Xr ck_ht_entry_key_length 3 ,
+.Xr ck_ht_entry_key 3 ,
+.Xr ck_ht_entry_set 3 ,
+.Xr ck_ht_entry_set_direct 3 ,
+.Xr ck_ht_entry_key_direct 3 ,
+.Xr ck_ht_entry_value 3 ,
+.Xr ck_ht_entry_value_direct 3 ,
+.Xr ck_ht_next 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_ht_next b/doc/ck_ht_next
new file mode 100644
index 000000000000..d0365a16ca0f
--- /dev/null
+++ b/doc/ck_ht_next
@@ -0,0 +1,107 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd March 30, 2012
+.Dt CK_HT_NEXT 3
+.Sh NAME
+.Nm ck_ht_next
+.Nd iterate to next entry in hash table
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_ht.h
+.Ft bool
+.Fn ck_ht_next "ck_ht_t *ht" "ck_ht_iterator_t *iterator" "ck_ht_entry_t **entry"
+.Sh DESCRIPTION
+The
+.Fn ck_ht_next
+function will increment the iterator object pointed to by
+.Fa iterator
+to point to the next non-empty hash table entry. If
+.Fn ck_ht_next
+returns
+.Dv true
+then the pointer pointed to by
+.Fa entry
+is initialized to the current hash table entry pointed to by
+the
+.Fa iterator
+object.
+.Pp
+It is expected that
+.Fa iterator
+has been initialized using the
+.Xr ck_ht_iterator_init 3
+function or statically initialized using
+.Dv CK_HT_ITERATOR_INITIALIZER.
+.Sh RETURN VALUES
+If
+.Fn ck_ht_next
+returns
+.Dv true
+then the object pointed to by
+.Fa entry
+points to a valid hash table entry. If
+.Fn ck_ht_next
+returns
+.Dv false
+then value of the object pointed to by
+.Fa entry
+is undefined.
+.Sh ERRORS
+Behavior is undefined if
+.Fa iterator
+or
+.Fa ht
+are uninitialized.
+.Sh SEE ALSO
+.Xr ck_ht_stat 3 ,
+.Xr ck_ht_init 3 ,
+.Xr ck_ht_destroy 3 ,
+.Xr ck_ht_hash 3 ,
+.Xr ck_ht_hash_direct 3 ,
+.Xr ck_ht_set_spmc 3 ,
+.Xr ck_ht_put_spmc 3 ,
+.Xr ck_ht_gc 3 ,
+.Xr ck_ht_get_spmc 3 ,
+.Xr ck_ht_grow_spmc 3 ,
+.Xr ck_ht_remove_spmc 3 ,
+.Xr ck_ht_count 3 ,
+.Xr ck_ht_reset_spmc 3 ,
+.Xr ck_ht_reset_size_spmc 3 ,
+.Xr ck_ht_entry_empty 3 ,
+.Xr ck_ht_entry_key_set 3 ,
+.Xr ck_ht_entry_key_set_direct 3 ,
+.Xr ck_ht_entry_key_length 3 ,
+.Xr ck_ht_entry_key 3 ,
+.Xr ck_ht_entry_set 3 ,
+.Xr ck_ht_entry_set_direct 3 ,
+.Xr ck_ht_entry_key_direct 3 ,
+.Xr ck_ht_entry_value 3 ,
+.Xr ck_ht_entry_value_direct 3 ,
+.Xr ck_ht_iterator_init 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_ht_put_spmc b/doc/ck_ht_put_spmc
new file mode 100644
index 000000000000..f5a638999cf9
--- /dev/null
+++ b/doc/ck_ht_put_spmc
@@ -0,0 +1,146 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd March 29, 2012
+.Dt CK_HT_PUT_SPMC 3
+.Sh NAME
+.Nm ck_ht_put_spmc
+.Nd store unique key-value pair into hash table
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_ht.h
+.Ft bool
+.Fn ck_ht_put_spmc "ck_ht_t *ht" "ck_ht_hash_t h" "ck_ht_entry_t *entry"
+.Sh DESCRIPTION
+The
+.Fn ck_ht_put_spmc
+function will store the key-value pair specified in the
+.Fa entry
+argument in the hash table pointed to by the
+.Fa ht
+argument. The key specified in
+.Fa entry
+is expected to have the hash value specified by the
+.Fa h
+argument.
+.Pp
+If
+.Fa ht
+was created with CK_HT_MODE_BYTESTRING then
+.Fa entry
+must have been initialized with the
+.Xr ck_ht_entry_set 3
+function. If
+.Fa ht
+was created with CK_HT_MODE_DIRECT then
+.Fa entry
+must have been initialized with the
+.Xr ck_ht_entry_set_direct 3
+function.
+.Pp
+It is expected that
+.Fa h
+was initialized with
+.Xr ck_ht_hash 3
+if
+.Fa ht
+was created with CK_HT_MODE_BYTESTRING. If
+.Fa ht
+was initialized with CK_HT_MODE_DIRECT then it is
+expected that
+.Fa h
+was initialized with the
+.Xr ck_ht_hash_direct 3
+function.
+.Pp
+If the call to
+.Fn ck_ht_put_spmc
+was successful then the key-value pair in
+.Fa entry
+was successfully stored in the hash table pointed
+to by
+.Fa ht
+and will fail if the key specified in
+.Fa entry
+already exists with-in the hash table. Replacement semantics
+are provided by the
+.Xr ck_ht_set_spmc 3
+function.
+.Pp
+This function is safe to call in the presence of concurrent
+.Xr ck_ht_get_spmc 3
+operations.
+.Sh RETURN VALUES
+Upon successful completion
+.Fn ck_ht_put_spmc
+returns
+.Dv true
+and otherwise returns
+.Dv false
+on failure.
+.Sh ERRORS
+.Bl -tag -width Er
+Behavior is undefined if
+.Fa entry
+or
+.Fa ht
+are uninitialized. The function will return
+.Dv false
+if the hash table required to be grown but failed
+while attempting to grow or if the key specified
+in
+.Fa entry
+was already present in the hash table.
+.El
+.Sh SEE ALSO
+.Xr ck_ht_stat 3 ,
+.Xr ck_ht_init 3 ,
+.Xr ck_ht_destroy 3 ,
+.Xr ck_ht_hash 3 ,
+.Xr ck_ht_hash_direct 3 ,
+.Xr ck_ht_set_spmc 3 ,
+.Xr ck_ht_gc 3 ,
+.Xr ck_ht_get_spmc 3 ,
+.Xr ck_ht_grow_spmc 3 ,
+.Xr ck_ht_remove_spmc 3 ,
+.Xr ck_ht_reset_spmc 3 ,
+.Xr ck_ht_reset_size_spmc 3 ,
+.Xr ck_ht_count 3 ,
+.Xr ck_ht_entry_empty 3 ,
+.Xr ck_ht_entry_key_set 3 ,
+.Xr ck_ht_entry_key_set_direct 3 ,
+.Xr ck_ht_entry_key 3 ,
+.Xr ck_ht_entry_key_length 3 ,
+.Xr ck_ht_entry_value 3 ,
+.Xr ck_ht_entry_set 3 ,
+.Xr ck_ht_entry_set_direct 3 ,
+.Xr ck_ht_entry_key_direct 3 ,
+.Xr ck_ht_entry_value_direct 3 ,
+.Xr ck_ht_iterator_init 3 ,
+.Xr ck_ht_next 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_ht_remove_spmc b/doc/ck_ht_remove_spmc
new file mode 100644
index 000000000000..a263866a6c14
--- /dev/null
+++ b/doc/ck_ht_remove_spmc
@@ -0,0 +1,117 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd March 29, 2012
+.Dt CK_HT_GROW_SPMC 3
+.Sh NAME
+.Nm ck_ht_remove_spmc
+.Nd resize a hash table if necessary
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_ht.h
+.Ft bool
+.Fn ck_ht_remove_spmc "ck_ht_t *ht" "ck_ht_hash_t h" "ck_ht_entry_t *entry"
+.Sh DESCRIPTION
+The
+.Fn ck_ht_remove_spmc
+function will remove the key-value pair associated with the
+key specified by the
+.Fa entry
+argument.
+.Pp
+If
+.Fa ht
+was created with CK_HT_MODE_BYTESTRING then
+.Fa entry
+must have been initialized with the
+.Xr ck_ht_entry_set_key 3
+or
+.Xr ck_ht_entry_set 3
+functions. If
+.Fa ht
+was created with CK_HT_MODE_DIRECT then
+.Fa entry
+must have been initialized with the
+.Xr ck_ht_entry_key_set_direct 3
+or
+.Xr ck_ht_entry_set_direct 3
+functions.
+.Pp
+It is expected that
+.Fa h
+was initialized with
+.Xr ck_ht_hash 3
+if
+.Fa ht
+was created with CK_HT_MODE_BYTESTRING. If
+.Fa ht
+was initialized with CK_HT_MODE_DIRECT then it is
+expected that
+.Fa h
+was initialized with the
+.Xr ck_ht_hash_direct 3
+function.
+.Sh RETURN VALUES
+If successful,
+.Fa entry
+will contain the key-value pair that was found in the hash table
+and
+.Fn ck_ht_remove_spmc
+will return
+.Dv true.
+If the entry could not be found then
+.Fn ck_ht_remove_spmc
+will return
+.Dv false.
+.Sh SEE ALSO
+.Xr ck_ht_stat 3 ,
+.Xr ck_ht_init 3 ,
+.Xr ck_ht_destroy 3 ,
+.Xr ck_ht_hash 3 ,
+.Xr ck_ht_hash_direct 3 ,
+.Xr ck_ht_set_spmc 3 ,
+.Xr ck_ht_put_spmc 3 ,
+.Xr ck_ht_gc 3 ,
+.Xr ck_ht_get_spmc 3 ,
+.Xr ck_ht_grow_spmc 3 ,
+.Xr ck_ht_reset_spmc 3 ,
+.Xr ck_ht_reset_size_spmc 3 ,
+.Xr ck_ht_count 3 ,
+.Xr ck_ht_entry_empty 3 ,
+.Xr ck_ht_entry_key_set 3 ,
+.Xr ck_ht_entry_key_set_direct 3 ,
+.Xr ck_ht_entry_key 3 ,
+.Xr ck_ht_entry_key_length 3 ,
+.Xr ck_ht_entry_value 3 ,
+.Xr ck_ht_entry_set 3 ,
+.Xr ck_ht_entry_set_direct 3 ,
+.Xr ck_ht_entry_key_direct 3 ,
+.Xr ck_ht_entry_value_direct 3 ,
+.Xr ck_ht_iterator_init 3 ,
+.Xr ck_ht_next 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_ht_reset_size_spmc b/doc/ck_ht_reset_size_spmc
new file mode 100644
index 000000000000..43083809e645
--- /dev/null
+++ b/doc/ck_ht_reset_size_spmc
@@ -0,0 +1,84 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd May 5, 2013
+.Dt CK_HT_RESET_SPMC 3
+.Sh NAME
+.Nm ck_ht_reset_size_spmc
+.Nd remove all entries from a hash table and reset size
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_ht.h
+.Ft bool
+.Fn ck_ht_reset_size_spmc "ck_ht_t *ht" "uint64_t capacity"
+.Sh DESCRIPTION
+The
+.Fn ck_ht_reset_size_spmc
+function will remove all key-value pairs stored in the hash
+table pointed to by the
+.Fa ht
+argument and create a new generation of the hash table that
+is preallocated for
+.Fa capacity
+entries.
+.Sh RETURN VALUES
+If successful,
+.Fn ck_ht_reset_size_spmc
+will return
+.Dv true
+and will otherwise return
+.Dv false.
+This function will only fail if a replacement hash table
+could not be allocated internally.
+.Sh SEE ALSO
+.Xr ck_ht_stat 3 ,
+.Xr ck_ht_init 3 ,
+.Xr ck_ht_destroy 3 ,
+.Xr ck_ht_hash 3 ,
+.Xr ck_ht_hash_direct 3 ,
+.Xr ck_ht_set_spmc 3 ,
+.Xr ck_ht_put_spmc 3 ,
+.Xr ck_ht_gc 3 ,
+.Xr ck_ht_get_spmc 3 ,
+.Xr ck_ht_grow_spmc 3 ,
+.Xr ck_ht_remove_spmc 3 ,
+.Xr ck_ht_count 3 ,
+.Xr ck_ht_entry_empty 3 ,
+.Xr ck_ht_entry_key_set 3 ,
+.Xr ck_ht_entry_key_set_direct 3 ,
+.Xr ck_ht_entry_key 3 ,
+.Xr ck_ht_entry_key_length 3 ,
+.Xr ck_ht_entry_value 3 ,
+.Xr ck_ht_entry_set 3 ,
+.Xr ck_ht_entry_set_direct 3 ,
+.Xr ck_ht_reset_spmc 3 ,
+.Xr ck_ht_entry_key_direct 3 ,
+.Xr ck_ht_entry_value_direct 3 ,
+.Xr ck_ht_iterator_init 3 ,
+.Xr ck_ht_next 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_ht_reset_spmc b/doc/ck_ht_reset_spmc
new file mode 100644
index 000000000000..dc2e60168b09
--- /dev/null
+++ b/doc/ck_ht_reset_spmc
@@ -0,0 +1,81 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd March 29, 2012
+.Dt CK_HT_RESET_SPMC 3
+.Sh NAME
+.Nm ck_ht_reset_spmc
+.Nd remove all entries from a hash table
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_ht.h
+.Ft bool
+.Fn ck_ht_reset_spmc "ck_ht_t *ht"
+.Sh DESCRIPTION
+The
+.Fn ck_ht_reset_spmc
+function will remove all key-value pairs stored in the hash
+table pointed to by the
+.Fa ht
+argument.
+.Sh RETURN VALUES
+If successful,
+.Fn ck_ht_reset_spmc
+will return
+.Dv true
+and will otherwise return
+.Dv false.
+This function will only fail if a replacement hash table
+could not be allocated internally.
+.Sh SEE ALSO
+.Xr ck_ht_stat 3 ,
+.Xr ck_ht_init 3 ,
+.Xr ck_ht_destroy 3 ,
+.Xr ck_ht_hash 3 ,
+.Xr ck_ht_hash_direct 3 ,
+.Xr ck_ht_set_spmc 3 ,
+.Xr ck_ht_put_spmc 3 ,
+.Xr ck_ht_gc 3 ,
+.Xr ck_ht_get_spmc 3 ,
+.Xr ck_ht_grow_spmc 3 ,
+.Xr ck_ht_remove_spmc 3 ,
+.Xr ck_ht_reset_size_spmc 3 ,
+.Xr ck_ht_count 3 ,
+.Xr ck_ht_entry_empty 3 ,
+.Xr ck_ht_entry_key_set 3 ,
+.Xr ck_ht_entry_key_set_direct 3 ,
+.Xr ck_ht_entry_key 3 ,
+.Xr ck_ht_entry_key_length 3 ,
+.Xr ck_ht_entry_value 3 ,
+.Xr ck_ht_entry_set 3 ,
+.Xr ck_ht_entry_set_direct 3 ,
+.Xr ck_ht_entry_key_direct 3 ,
+.Xr ck_ht_entry_value_direct 3 ,
+.Xr ck_ht_iterator_init 3 ,
+.Xr ck_ht_next 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_ht_set_spmc b/doc/ck_ht_set_spmc
new file mode 100644
index 000000000000..e0fe1ae386aa
--- /dev/null
+++ b/doc/ck_ht_set_spmc
@@ -0,0 +1,140 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd March 29, 2012
+.Dt CK_HT_SET_SPMC 3
+.Sh NAME
+.Nm ck_ht_set_spmc
+.Nd store key-value pair into hash table
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_ht.h
+.Ft bool
+.Fn ck_ht_set_spmc "ck_ht_t *ht" "ck_ht_hash_t h" "ck_ht_entry_t *entry"
+.Sh DESCRIPTION
+The
+.Fn ck_ht_set_spmc
+function will store the key-value pair specified in the
+.Fa entry
+argument in the hash table pointed to by the
+.Fa ht
+argument. The key specified in
+.Fa entry
+is expected to have the hash value specified by the
+.Fa h
+argument.
+.Pp
+If
+.Fa ht
+was created with CK_HT_MODE_BYTESTRING then
+.Fa entry
+must have been initialized with the
+.Xr ck_ht_entry_set 3
+function. If
+.Fa ht
+was created with CK_HT_MODE_DIRECT then
+.Fa entry
+must have been initialized with the
+.Xr ck_ht_entry_set_direct 3
+function.
+.Pp
+It is expected that
+.Fa h
+was initialized with
+.Xr ck_ht_hash 3
+if
+.Fa ht
+was created with CK_HT_MODE_BYTESTRING. If
+.Fa ht
+was initialized with CK_HT_MODE_DIRECT then it is
+expected that
+.Fa h
+was initialized with the
+.Xr ck_ht_hash_direct 3
+function.
+.Pp
+If the call to
+.Fn ck_ht_set_spmc
+was successful then the key-value pair in
+.Fa entry
+will contain the previous key-value pair associated
+with the key originally contained in the
+.Fa entry
+argument. If the operation was unsuccessful then
+.Fa entry
+is unmodified.
+.Pp
+This function is safe to call in the presence of concurrent
+.Xr ck_ht_get_spmc
+operations.
+.Sh RETURN VALUES
+Upon successful completion
+.Fn ck_ht_set_spmc
+returns
+.Dv true
+and otherwise returns
+.Dv false
+on failure.
+.Sh ERRORS
+.Bl -tag -width Er
+Behavior is undefined if
+.Fa entry
+or
+.Fa ht
+are uninitialized. The function will return
+.Dv false
+if the hash table required to be grown but failed
+while attempting to grow.
+.El
+.Sh SEE ALSO
+.Xr ck_ht_stat 3 ,
+.Xr ck_ht_init 3 ,
+.Xr ck_ht_destroy 3 ,
+.Xr ck_ht_hash 3 ,
+.Xr ck_ht_hash_direct 3 ,
+.Xr ck_ht_put_spmc 3 ,
+.Xr ck_ht_gc 3 ,
+.Xr ck_ht_get_spmc 3 ,
+.Xr ck_ht_grow_spmc 3 ,
+.Xr ck_ht_remove_spmc 3 ,
+.Xr ck_ht_reset_spmc 3 ,
+.Xr ck_ht_reset_size_spmc 3 ,
+.Xr ck_ht_count 3 ,
+.Xr ck_ht_entry_empty 3 ,
+.Xr ck_ht_entry_key_set 3 ,
+.Xr ck_ht_entry_key_set_direct 3 ,
+.Xr ck_ht_entry_key 3 ,
+.Xr ck_ht_entry_key_length 3 ,
+.Xr ck_ht_entry_value 3 ,
+.Xr ck_ht_entry_set 3 ,
+.Xr ck_ht_entry_set_direct 3 ,
+.Xr ck_ht_entry_key_direct 3 ,
+.Xr ck_ht_entry_value_direct 3 ,
+.Xr ck_ht_iterator_init 3 ,
+.Xr ck_ht_next 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_ht_stat b/doc/ck_ht_stat
new file mode 100644
index 000000000000..6d2f1cde5717
--- /dev/null
+++ b/doc/ck_ht_stat
@@ -0,0 +1,85 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd September 17, 2012
+.Dt CK_HT_STAT 3
+.Sh NAME
+.Nm ck_ht_stat
+.Nd get hash table status
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_ht.h
+.Ft void
+.Fn ck_ht_stat "ck_ht_t *ht" "struct ck_ht_stat *st"
+.Sh DESCRIPTION
+The
+.Fn ck_ht_stat 3
+function will store various hash set statistics in the object
+pointed to by
+.Fa st .
+The ck_ht_stat structure is defined as follows:
+.Bd -literal -offset indent
+struct ck_ht_stat {
+ uint64_t probe_maximum; /* Longest read-side probe sequence. */
+ uint64_t n_entries; /* Current number of keys in hash set. */
+};
+.Ed
+.Sh RETURN VALUES
+.Fn ck_ht_stat 3
+has no return value.
+.Sh ERRORS
+Behavior is undefined if
+.Fa ht
+has not been initialized.
+.Sh SEE ALSO
+.Xr ck_ht_count 3 ,
+.Xr ck_ht_init 3 ,
+.Xr ck_ht_destroy 3 ,
+.Xr ck_ht_hash 3 ,
+.Xr ck_ht_hash_direct 3 ,
+.Xr ck_ht_set_spmc 3 ,
+.Xr ck_ht_put_spmc 3 ,
+.Xr ck_ht_gc 3 ,
+.Xr ck_ht_get_spmc 3 ,
+.Xr ck_ht_grow_spmc 3 ,
+.Xr ck_ht_remove_spmc 3 ,
+.Xr ck_ht_reset_spmc 3 ,
+.Xr ck_ht_reset_size_spmc 3 ,
+.Xr ck_ht_entry_empty 3 ,
+.Xr ck_ht_entry_key_set 3 ,
+.Xr ck_ht_entry_key_set_direct 3 ,
+.Xr ck_ht_entry_key 3 ,
+.Xr ck_ht_entry_key_length 3 ,
+.Xr ck_ht_entry_value 3 ,
+.Xr ck_ht_entry_set 3 ,
+.Xr ck_ht_entry_set_direct 3 ,
+.Xr ck_ht_entry_key_direct 3 ,
+.Xr ck_ht_entry_value_direct 3 ,
+.Xr ck_ht_iterator_init 3 ,
+.Xr ck_ht_next 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_pflock b/doc/ck_pflock
new file mode 100644
index 000000000000..6fea7017c530
--- /dev/null
+++ b/doc/ck_pflock
@@ -0,0 +1,95 @@
+.\"
+.\" Copyright 2014 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd April 22, 2014.
+.Dt ck_pflock 3
+.Sh NAME
+.Nm ck_pflock_init ,
+.Nm ck_pflock_write_lock ,
+.Nm ck_pflock_write_unlock ,
+.Nm ck_pflock_read_lock ,
+.Nm ck_pflock_read_unlock ,
+.Nd centralized phase-fair reader-writer locks
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_pflock.h
+.Pp
+.Dv ck_pflock_t lock = CK_PFLOCK_INITIALIZER;
+.Pp
+.Ft void
+.Fn ck_pflock_init "ck_pflock_t *lock"
+.Ft void
+.Fn ck_pflock_write_lock "ck_pflock_t *lock"
+.Ft void
+.Fn ck_pflock_write_unlock "ck_pflock_t *lock"
+.Ft void
+.Fn ck_pflock_read_lock "ck_pflock_t *lock"
+.Ft void
+.Fn ck_pflock_read_unlock "ck_pflock_t *lock"
+.Sh DESCRIPTION
+This is a centralized phase-fair reader-writer lock. It
+requires little space overhead and has a low latency
+fast path.
+.Sh EXAMPLE
+.Bd -literal -offset indent
+#include <ck_pflock.h>
+
+static ck_pflock_t lock = CK_TFLOCK_INITIALIZER;
+
+static void
+reader(void)
+{
+
+ for (;;) {
+ ck_pflock_read_lock(&lock);
+ /* Read-side critical section. */
+ ck_pflock_read_unlock(&lock);
+ }
+
+ return;
+}
+
+static void
+writer(void)
+{
+
+ for (;;) {
+ ck_pflock_write_lock(&lock);
+ /* Write-side critical section. */
+ ck_pflock_write_unlock(&lock);
+ }
+
+ return;
+}
+.Ed
+.Sh SEE ALSO
+.Xr ck_brlock 3 ,
+.Xr ck_rwlock 3 ,
+.Xr ck_tflock 3 ,
+.Xr ck_swlock 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_pr b/doc/ck_pr
new file mode 100644
index 000000000000..67c726feca3f
--- /dev/null
+++ b/doc/ck_pr
@@ -0,0 +1,71 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd April 7, 2013
+.Dt ck_pr 3
+.Sh NAME
+.Nm ck_pr
+.Nd concurrency primitives interface
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_pr.h
+.Sh DESCRIPTION
+ck_pr.h provides an interface to volatile atomic instructions,
+memory barriers and busy-wait facilities as provided by the
+underlying processor. The presence of an atomic operation
+is detected by the presence of a corresponding CK_F_PR macro.
+For example, the availability of
+.Xr ck_pr_add_16 3
+would be determined by the presence of CK_F_PR_ADD_16.
+.Sh SEE ALSO
+.Xr ck_pr_stall 3 ,
+.Xr ck_pr_fence_acquire 3 ,
+.Xr ck_pr_fence_release 3 ,
+.Xr ck_pr_fence_load 3 ,
+.Xr ck_pr_fence_load_depends 3 ,
+.Xr ck_pr_fence_store 3 ,
+.Xr ck_pr_fence_memory 3 ,
+.Xr ck_pr_barrier 3 ,
+.Xr ck_pr_fas 3 ,
+.Xr ck_pr_load 3 ,
+.Xr ck_pr_store 3 ,
+.Xr ck_pr_faa 3 ,
+.Xr ck_pr_inc 3 ,
+.Xr ck_pr_dec 3 ,
+.Xr ck_pr_neg 3 ,
+.Xr ck_pr_not 3 ,
+.Xr ck_pr_add 3 ,
+.Xr ck_pr_sub 3 ,
+.Xr ck_pr_and 3 ,
+.Xr ck_pr_or 3 ,
+.Xr ck_pr_xor 3 ,
+.Xr ck_pr_cas 3 ,
+.Xr ck_pr_btc 3 ,
+.Xr ck_pr_bts 3 ,
+.Xr ck_pr_btr 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_pr_add b/doc/ck_pr_add
new file mode 100644
index 000000000000..b4d394a63f3d
--- /dev/null
+++ b/doc/ck_pr_add
@@ -0,0 +1,93 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd April 11, 2013
+.Dt ck_pr_add 3
+.Sh NAME
+.Nm ck_pr_add_ptr ,
+.Nm ck_pr_add_double ,
+.Nm ck_pr_add_char ,
+.Nm ck_pr_add_uint ,
+.Nm ck_pr_add_int ,
+.Nm ck_pr_add_64 ,
+.Nm ck_pr_add_32 ,
+.Nm ck_pr_add_16 ,
+.Nm ck_pr_add_8
+.Nd atomic addition operations
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_pr.h
+.Ft void
+.Fn ck_pr_add_ptr "void *target" "uintptr_t delta"
+.Ft void
+.Fn ck_pr_add_double "double *target" "double delta"
+.Ft void
+.Fn ck_pr_add_char "char *target" "char delta"
+.Ft void
+.Fn ck_pr_add_uint "unsigned int *target" "unsigned int delta"
+.Ft void
+.Fn ck_pr_add_int "int *target" "int delta"
+.Ft void
+.Fn ck_pr_add_64 "uint64_t *target" "uint64_t delta"
+.Ft void
+.Fn ck_pr_add_32 "uint32_t *target" "uint32_t delta"
+.Ft void
+.Fn ck_pr_add_16 "uint16_t *target" "uint16_t delta"
+.Ft void
+.Fn ck_pr_add_8 "uint8_t *target" "uint8_t delta"
+.Sh DESCRIPTION
+The
+.Fn ck_pr_add 3
+family of functions atomically add the value specified by
+.Fa delta
+to the value pointed to by
+.Fa target .
+.Sh RETURN VALUES
+This family of functions does not have a return value.
+.Sh SEE ALSO
+.Xr ck_pr_fence_load 3 ,
+.Xr ck_pr_fence_load_depends 3 ,
+.Xr ck_pr_fence_store 3 ,
+.Xr ck_pr_fence_memory 3 ,
+.Xr ck_pr_load 3 ,
+.Xr ck_pr_store 3 ,
+.Xr ck_pr_fas 3 ,
+.Xr ck_pr_faa 3 ,
+.Xr ck_pr_inc 3 ,
+.Xr ck_pr_dec 3 ,
+.Xr ck_pr_neg 3 ,
+.Xr ck_pr_not 3 ,
+.Xr ck_pr_sub 3 ,
+.Xr ck_pr_and 3 ,
+.Xr ck_pr_or 3 ,
+.Xr ck_pr_xor 3 ,
+.Xr ck_pr_cas 3 ,
+.Xr ck_pr_btc 3 ,
+.Xr ck_pr_bts 3 ,
+.Xr ck_pr_btr 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_pr_and b/doc/ck_pr_and
new file mode 100644
index 000000000000..56ce5af13542
--- /dev/null
+++ b/doc/ck_pr_and
@@ -0,0 +1,93 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd April 11, 2013
+.Dt ck_pr_and 3
+.Sh NAME
+.Nm ck_pr_and_ptr ,
+.Nm ck_pr_and_char ,
+.Nm ck_pr_and_uint ,
+.Nm ck_pr_and_int ,
+.Nm ck_pr_and_64 ,
+.Nm ck_pr_and_32 ,
+.Nm ck_pr_and_16 ,
+.Nm ck_pr_and_8
+.Nd atomic bitwise-and operations
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_pr.h
+.Ft void
+.Fn ck_pr_and_ptr "void *target" "uintptr_t delta"
+.Ft void
+.Fn ck_pr_and_char "char *target" "char delta"
+.Ft void
+.Fn ck_pr_and_uint "unsigned int *target" "unsigned int delta"
+.Ft void
+.Fn ck_pr_and_int "int *target" "int delta"
+.Ft void
+.Fn ck_pr_and_64 "uint64_t *target" "uint64_t delta"
+.Ft void
+.Fn ck_pr_and_32 "uint32_t *target" "uint32_t delta"
+.Ft void
+.Fn ck_pr_and_16 "uint16_t *target" "uint16_t delta"
+.Ft void
+.Fn ck_pr_and_8 "uint8_t *target" "uint8_t delta"
+.Sh DESCRIPTION
+The
+.Fn ck_pr_and 3
+family of functions atomically compute and store the
+result of a bitwise-and of the value pointed to by
+.Fa target
+and
+.Fa delta
+into the value pointed to by
+.Fa target .
+.Sh RETURN VALUES
+This family of functions does not have a return value.
+.Sh SEE ALSO
+.Xr ck_pr_fence_load 3 ,
+.Xr ck_pr_fence_load_depends 3 ,
+.Xr ck_pr_fence_store 3 ,
+.Xr ck_pr_fence_memory 3 ,
+.Xr ck_pr_load 3 ,
+.Xr ck_pr_store 3 ,
+.Xr ck_pr_fas 3 ,
+.Xr ck_pr_faa 3 ,
+.Xr ck_pr_inc 3 ,
+.Xr ck_pr_dec 3 ,
+.Xr ck_pr_neg 3 ,
+.Xr ck_pr_not 3 ,
+.Xr ck_pr_add 3 ,
+.Xr ck_pr_sub 3 ,
+.Xr ck_pr_or 3 ,
+.Xr ck_pr_xor 3 ,
+.Xr ck_pr_cas 3 ,
+.Xr ck_pr_btc 3 ,
+.Xr ck_pr_bts 3 ,
+.Xr ck_pr_btr 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_pr_barrier b/doc/ck_pr_barrier
new file mode 100644
index 000000000000..38867291dbbc
--- /dev/null
+++ b/doc/ck_pr_barrier
@@ -0,0 +1,66 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd April 7, 2013
+.Dt ck_pr_barrier 3
+.Sh NAME
+.Nm ck_pr_barrier
+.Nd compiler optimization barrier
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_pr.h
+.Ft void
+.Fn ck_pr_barrier void
+.Sh DESCRIPTION
+The
+.Fn ck_pr_barrier 3
+function is used to disable code movement optimizations
+across the invocation of the function.
+.Sh SEE ALSO
+.Xr ck_pr_fence_load 3 ,
+.Xr ck_pr_fence_load_depends 3 ,
+.Xr ck_pr_fence_store 3 ,
+.Xr ck_pr_fence_memory 3 ,
+.Xr ck_pr_fas 3 ,
+.Xr ck_pr_load 3 ,
+.Xr ck_pr_store 3 ,
+.Xr ck_pr_faa 3 ,
+.Xr ck_pr_inc 3 ,
+.Xr ck_pr_dec 3 ,
+.Xr ck_pr_neg 3 ,
+.Xr ck_pr_not 3 ,
+.Xr ck_pr_add 3 ,
+.Xr ck_pr_sub 3 ,
+.Xr ck_pr_and 3 ,
+.Xr ck_pr_or 3 ,
+.Xr ck_pr_xor 3 ,
+.Xr ck_pr_cas 3 ,
+.Xr ck_pr_btc 3 ,
+.Xr ck_pr_bts 3 ,
+.Xr ck_pr_btr 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_pr_btc b/doc/ck_pr_btc
new file mode 100644
index 000000000000..5956221e3f19
--- /dev/null
+++ b/doc/ck_pr_btc
@@ -0,0 +1,90 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd April 11, 2013
+.Dt ck_pr_btc 3
+.Sh NAME
+.Nm ck_pr_btc_ptr ,
+.Nm ck_pr_btc_uint ,
+.Nm ck_pr_btc_int ,
+.Nm ck_pr_btc_64 ,
+.Nm ck_pr_btc_32 ,
+.Nm ck_pr_btc_16
+.Nd atomic bit test-and-complement operations
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_pr.h
+.Ft bool
+.Fn ck_pr_btc_ptr "void *target" "unsigned int bit_index"
+.Ft bool
+.Fn ck_pr_btc_uint "uint *target" "unsigned int bit_index"
+.Ft bool
+.Fn ck_pr_btc_int "int *target" "unsigned int bit_index"
+.Ft bool
+.Fn ck_pr_btc_64 "uint64_t *target" "unsigned int bit_index"
+.Ft bool
+.Fn ck_pr_btc_32 "uint32_t *target" "unsigned int bit_index"
+.Ft bool
+.Fn ck_pr_btc_16 "uint16_t *target" "unsigned int bit_index"
+.Sh DESCRIPTION
+The
+.Fn ck_pr_btc 3
+family of functions atomically fetch the value
+of the bit in
+.Fa target
+at index
+.Fa bit_index
+and set that bit to its complement.
+.Sh RETURN VALUES
+These family of functions return the original value of
+the bit at offset
+.Fa bit_index
+that is in the value pointed to by
+.Fa target .
+.Sh SEE ALSO
+.Xr ck_pr_fence_load 3 ,
+.Xr ck_pr_fence_load_depends 3 ,
+.Xr ck_pr_fence_store 3 ,
+.Xr ck_pr_fence_memory 3 ,
+.Xr ck_pr_load 3 ,
+.Xr ck_pr_store 3 ,
+.Xr ck_pr_fas 3 ,
+.Xr ck_pr_faa 3 ,
+.Xr ck_pr_inc 3 ,
+.Xr ck_pr_dec 3 ,
+.Xr ck_pr_neg 3 ,
+.Xr ck_pr_not 3 ,
+.Xr ck_pr_sub 3 ,
+.Xr ck_pr_and 3 ,
+.Xr ck_pr_or 3 ,
+.Xr ck_pr_xor 3 ,
+.Xr ck_pr_add 3 ,
+.Xr ck_pr_btc 3 ,
+.Xr ck_pr_btr 3 ,
+.Xr ck_pr_cas 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_pr_btr b/doc/ck_pr_btr
new file mode 100644
index 000000000000..d5e03fd64c75
--- /dev/null
+++ b/doc/ck_pr_btr
@@ -0,0 +1,90 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd April 11, 2013
+.Dt ck_pr_btr 3
+.Sh NAME
+.Nm ck_pr_btr_ptr ,
+.Nm ck_pr_btr_uint ,
+.Nm ck_pr_btr_int ,
+.Nm ck_pr_btr_64 ,
+.Nm ck_pr_btr_32 ,
+.Nm ck_pr_btr_16
+.Nd atomic bit test-and-reset operations
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_pr.h
+.Ft bool
+.Fn ck_pr_btr_ptr "void *target" "unsigned int bit_index"
+.Ft bool
+.Fn ck_pr_btr_uint "uint *target" "unsigned int bit_index"
+.Ft bool
+.Fn ck_pr_btr_int "int *target" "unsigned int bit_index"
+.Ft bool
+.Fn ck_pr_btr_64 "uint64_t *target" "unsigned int bit_index"
+.Ft bool
+.Fn ck_pr_btr_32 "uint32_t *target" "unsigned int bit_index"
+.Ft bool
+.Fn ck_pr_btr_16 "uint16_t *target" "unsigned int bit_index"
+.Sh DESCRIPTION
+The
+.Fn ck_pr_btr 3
+family of functions atomically fetch the value
+of the bit in
+.Fa target
+at index
+.Fa bit_index
+and set that bit to 0.
+.Sh RETURN VALUES
+This family of functions returns the original value of
+the bit at offset
+.Fa bit_index
+that is in the value pointed to by
+.Fa target .
+.Sh SEE ALSO
+.Xr ck_pr_fence_load 3 ,
+.Xr ck_pr_fence_load_depends 3 ,
+.Xr ck_pr_fence_store 3 ,
+.Xr ck_pr_fence_memory 3 ,
+.Xr ck_pr_load 3 ,
+.Xr ck_pr_store 3 ,
+.Xr ck_pr_fas 3 ,
+.Xr ck_pr_faa 3 ,
+.Xr ck_pr_inc 3 ,
+.Xr ck_pr_dec 3 ,
+.Xr ck_pr_neg 3 ,
+.Xr ck_pr_not 3 ,
+.Xr ck_pr_sub 3 ,
+.Xr ck_pr_and 3 ,
+.Xr ck_pr_or 3 ,
+.Xr ck_pr_xor 3 ,
+.Xr ck_pr_add 3 ,
+.Xr ck_pr_btc 3 ,
+.Xr ck_pr_bts 3 ,
+.Xr ck_pr_cas 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_pr_bts b/doc/ck_pr_bts
new file mode 100644
index 000000000000..955855d71657
--- /dev/null
+++ b/doc/ck_pr_bts
@@ -0,0 +1,90 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd April 11, 2013
+.Dt ck_pr_bts 3
+.Sh NAME
+.Nm ck_pr_bts_ptr ,
+.Nm ck_pr_bts_uint ,
+.Nm ck_pr_bts_int ,
+.Nm ck_pr_bts_64 ,
+.Nm ck_pr_bts_32 ,
+.Nm ck_pr_bts_16
+.Nd atomic bit test-and-set operations
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_pr.h
+.Ft bool
+.Fn ck_pr_bts_ptr "void *target" "unsigned int bit_index"
+.Ft bool
+.Fn ck_pr_bts_uint "uint *target" "unsigned int bit_index"
+.Ft bool
+.Fn ck_pr_bts_int "int *target" "unsigned int bit_index"
+.Ft bool
+.Fn ck_pr_bts_64 "uint64_t *target" "unsigned int bit_index"
+.Ft bool
+.Fn ck_pr_bts_32 "uint32_t *target" "unsigned int bit_index"
+.Ft bool
+.Fn ck_pr_bts_16 "uint16_t *target" "unsigned int bit_index"
+.Sh DESCRIPTION
+The
+.Fn ck_pr_bts 3
+family of functions atomically fetch the value
+of the bit in
+.Fa target
+at index
+.Fa bit_index
+and set that bit to 1.
+.Sh RETURN VALUES
+This family of functions returns the original value of
+the bit at offset
+.Fa bit_index
+that is in the value pointed to by
+.Fa target .
+.Sh SEE ALSO
+.Xr ck_pr_fence_load 3 ,
+.Xr ck_pr_fence_load_depends 3 ,
+.Xr ck_pr_fence_store 3 ,
+.Xr ck_pr_fence_memory 3 ,
+.Xr ck_pr_load 3 ,
+.Xr ck_pr_store 3 ,
+.Xr ck_pr_fas 3 ,
+.Xr ck_pr_faa 3 ,
+.Xr ck_pr_inc 3 ,
+.Xr ck_pr_dec 3 ,
+.Xr ck_pr_neg 3 ,
+.Xr ck_pr_not 3 ,
+.Xr ck_pr_sub 3 ,
+.Xr ck_pr_and 3 ,
+.Xr ck_pr_or 3 ,
+.Xr ck_pr_xor 3 ,
+.Xr ck_pr_add 3 ,
+.Xr ck_pr_btc 3 ,
+.Xr ck_pr_btr 3 ,
+.Xr ck_pr_cas 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_pr_cas b/doc/ck_pr_cas
new file mode 100644
index 000000000000..9d1d39b22aed
--- /dev/null
+++ b/doc/ck_pr_cas
@@ -0,0 +1,147 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd April 11, 2013
+.Dt ck_pr_cas 3
+.Sh NAME
+.Nm ck_pr_cas_ptr ,
+.Nm ck_pr_cas_ptr_value ,
+.Nm ck_pr_cas_ptr_2 ,
+.Nm ck_pr_cas_ptr_2_value ,
+.Nm ck_pr_cas_double ,
+.Nm ck_pr_cas_double_value ,
+.Nm ck_pr_cas_char ,
+.Nm ck_pr_cas_char_value ,
+.Nm ck_pr_cas_uint ,
+.Nm ck_pr_cas_uint_value ,
+.Nm ck_pr_cas_int ,
+.Nm ck_pr_cas_int_value ,
+.Nm ck_pr_cas_64_2 ,
+.Nm ck_pr_cas_64_2_value ,
+.Nm ck_pr_cas_64 ,
+.Nm ck_pr_cas_64_value ,
+.Nm ck_pr_cas_32 ,
+.Nm ck_pr_cas_32_value ,
+.Nm ck_pr_cas_16 ,
+.Nm ck_pr_cas_16_value ,
+.Nm ck_pr_cas_8 ,
+.Nm ck_pr_cas_8_value
+.Nd atomic compare-and-swap operations
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_pr.h
+.Ft bool
+.Fn ck_pr_cas_ptr "void *target" "void *old_value" "void *new_value"
+.Ft bool
+.Fn ck_pr_cas_ptr_value "void *target" "void *old_value" "void *new_value" "void *original_value"
+.Ft bool
+.Fn ck_pr_cas_ptr_2 "void *target" "void *old_value" "void *new_value"
+.Ft bool
+.Fn ck_pr_cas_ptr_2_value "void *target" "void *old_value" "void *new_value" "void *original_value"
+.Ft bool
+.Fn ck_pr_cas_double "double *target" "double old_value" "double new_value"
+.Ft bool
+.Fn ck_pr_cas_double_value "double *target" "double old_value" "double new_value" "double *original_value"
+.Ft bool
+.Fn ck_pr_cas_char "char *target" "char old_value" "char new_value"
+.Ft bool
+.Fn ck_pr_cas_char_value "char *target" "char old_value" "char new_value" "char *original_value"
+.Ft bool
+.Fn ck_pr_cas_uint "unsigned int *target" "unsigned int old_value" "unsigned int new_value"
+.Ft bool
+.Fn ck_pr_cas_uint_value "unsigned int *target" "unsigned int old_value" "unsigned int new_value" "unsigned int *original_value"
+.Ft bool
+.Fn ck_pr_cas_int "int *target" "int old_value" "int new_value"
+.Ft bool
+.Fn ck_pr_cas_int_value "int *target" "int old_value" "int new_value" "int *original_value"
+.Ft bool
+.Fn ck_pr_cas_64_2 "uint64_t target[static 2]" "uint64_t old_value[static 2]" "uint64_t new_value[static 2]"
+.Ft bool
+.Fn ck_pr_cas_64_2_value "uint64_t target[static 2]" "uint64_t old_value[static 2]" "uint64_t new_value[static 2]" "uint64_t original_value[static 2]"
+.Ft bool
+.Fn ck_pr_cas_64 "uint64_t *target" "uint64_t old_value" "uint64_t new_value"
+.Ft bool
+.Fn ck_pr_cas_64_value "uint64_t *target" "uint64_t old_value" "uint64_t new_value" "uint64_t *original_value"
+.Ft bool
+.Fn ck_pr_cas_32 "uint32_t *target" "uint32_t old_value" "uint32_t new_value"
+.Ft bool
+.Fn ck_pr_cas_32_value "uint32_t *target" "uint32_t old_value" "uint32_t new_value" "uint32_t *original_value"
+.Ft bool
+.Fn ck_pr_cas_16 "uint16_t *target" "uint16_t old_value" "uint16_t new_value"
+.Ft bool
+.Fn ck_pr_cas_16_value "uint16_t *target" "uint16_t old_value" "uint16_t new_value" "uint16_t *original_value"
+.Ft bool
+.Fn ck_pr_cas_8 "uint8_t *target" "uint8_t old_value" "uint8_t new_value"
+.Ft bool
+.Fn ck_pr_cas_8_value "uint8_t *target" "uint8_t old_value" "uint8_t new_value" "uint8_t *original_value"
+.Sh DESCRIPTION
+The
+.Fn ck_pr_cas 3
+family of functions atomically compare the value in
+.Fa target
+for equality with
+.Fa old_value
+and if so, replace the value pointed to by
+.Fa target
+with the value specified by
+.Fa new_value .
+If the value in
+.Fa target
+was not equal to the value specified by
+.Fa old_value
+then no modifications occur to the value in
+.Fa target .
+The *_value form of these functions unconditionally update
+.Fa original_value .
+.Sh RETURN VALUES
+This family of functions return true if the value in
+.Fa target
+was modified as a result of the operation. Otherwise, they
+return false.
+.Sh SEE ALSO
+.Xr ck_pr_fence_load 3 ,
+.Xr ck_pr_fence_load_depends 3 ,
+.Xr ck_pr_fence_store 3 ,
+.Xr ck_pr_fence_memory 3 ,
+.Xr ck_pr_load 3 ,
+.Xr ck_pr_store 3 ,
+.Xr ck_pr_fas 3 ,
+.Xr ck_pr_faa 3 ,
+.Xr ck_pr_inc 3 ,
+.Xr ck_pr_dec 3 ,
+.Xr ck_pr_neg 3 ,
+.Xr ck_pr_not 3 ,
+.Xr ck_pr_sub 3 ,
+.Xr ck_pr_and 3 ,
+.Xr ck_pr_or 3 ,
+.Xr ck_pr_xor 3 ,
+.Xr ck_pr_add 3 ,
+.Xr ck_pr_btc 3 ,
+.Xr ck_pr_bts 3 ,
+.Xr ck_pr_btr 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_pr_dec b/doc/ck_pr_dec
new file mode 100644
index 000000000000..f3d34dd7aadb
--- /dev/null
+++ b/doc/ck_pr_dec
@@ -0,0 +1,124 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd April 7, 2013
+.Dt ck_pr_dec 3
+.Sh NAME
+.Nm ck_pr_dec_ptr ,
+.Nm ck_pr_dec_ptr_zero ,
+.Nm ck_pr_dec_double ,
+.Nm ck_pr_dec_double_zero ,
+.Nm ck_pr_dec_char ,
+.Nm ck_pr_dec_char_zero ,
+.Nm ck_pr_dec_uint ,
+.Nm ck_pr_dec_uint_zero ,
+.Nm ck_pr_dec_int ,
+.Nm ck_pr_dec_int_zero ,
+.Nm ck_pr_dec_64 ,
+.Nm ck_pr_dec_64_zero ,
+.Nm ck_pr_dec_32 ,
+.Nm ck_pr_dec_32_zero ,
+.Nm ck_pr_dec_16 ,
+.Nm ck_pr_dec_16_zero ,
+.Nm ck_pr_dec_8 ,
+.Nm ck_pr_dec_8_zero
+.Nd atomic decrement operations
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_pr.h
+.Ft void
+.Fn ck_pr_dec_ptr "void *target"
+.Ft void
+.Fn ck_pr_dec_ptr_zero "void *target" "bool *z"
+.Ft void
+.Fn ck_pr_dec_double "double *target"
+.Ft void
+.Fn ck_pr_dec_double_zero "double *target" "bool *z"
+.Ft void
+.Fn ck_pr_dec_char "char *target"
+.Ft void
+.Fn ck_pr_dec_char_zero "char *target" "bool *z"
+.Ft void
+.Fn ck_pr_dec_uint "unsigned int *target"
+.Ft void
+.Fn ck_pr_dec_uint_zero "unsigned int *target" "bool *z"
+.Ft void
+.Fn ck_pr_dec_int "int *target"
+.Ft void
+.Fn ck_pr_dec_int_zero "int *target" "bool *z"
+.Ft void
+.Fn ck_pr_dec_64 "uint64_t *target"
+.Ft void
+.Fn ck_pr_dec_64_zero "uint64_t *target" "bool *z"
+.Ft void
+.Fn ck_pr_dec_32 "uint32_t *target"
+.Ft void
+.Fn ck_pr_dec_32_zero "uint32_t *target" "bool *z"
+.Ft void
+.Fn ck_pr_dec_16 "uint16_t *target"
+.Ft void
+.Fn ck_pr_dec_16_zero "uint16_t *target" "bool *z"
+.Ft void
+.Fn ck_pr_dec_8 "uint8_t *target"
+.Ft void
+.Fn ck_pr_dec_8_zero "uint8_t *target" "bool *z"
+.Sh DESCRIPTION
+The
+.Fn ck_pr_dec 3
+family of functions atomically decrement the value pointed to
+by
+.Fa target .
+.Sh RETURN VALUES
+The ck_pr_dec_zero family of functions set the value pointed to by
+.Fa z
+to true if the result
+of the decrement operation was 0. They set the value pointed to by
+.Fa z
+to false otherwise.
+.Sh SEE ALSO
+.Xr ck_pr_fence_load 3 ,
+.Xr ck_pr_fence_load_depends 3 ,
+.Xr ck_pr_fence_store 3 ,
+.Xr ck_pr_fence_memory 3 ,
+.Xr ck_pr_load 3 ,
+.Xr ck_pr_store 3 ,
+.Xr ck_pr_fas 3 ,
+.Xr ck_pr_faa 3 ,
+.Xr ck_pr_inc 3 ,
+.Xr ck_pr_neg 3 ,
+.Xr ck_pr_not 3 ,
+.Xr ck_pr_add 3 ,
+.Xr ck_pr_sub 3 ,
+.Xr ck_pr_and 3 ,
+.Xr ck_pr_or 3 ,
+.Xr ck_pr_xor 3 ,
+.Xr ck_pr_cas 3 ,
+.Xr ck_pr_btc 3 ,
+.Xr ck_pr_bts 3 ,
+.Xr ck_pr_btr 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_pr_faa b/doc/ck_pr_faa
new file mode 100644
index 000000000000..fbeff01af128
--- /dev/null
+++ b/doc/ck_pr_faa
@@ -0,0 +1,99 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd April 7, 2013
+.Dt ck_pr_faa 3
+.Sh NAME
+.Nm ck_pr_faa_ptr ,
+.Nm ck_pr_faa_double ,
+.Nm ck_pr_faa_char ,
+.Nm ck_pr_faa_uint ,
+.Nm ck_pr_faa_int ,
+.Nm ck_pr_faa_64 ,
+.Nm ck_pr_faa_32 ,
+.Nm ck_pr_faa_16 ,
+.Nm ck_pr_faa_8
+.Nd atomic fetch-and-add operations
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_pr.h
+.Ft uintptr_t
+.Fn ck_pr_faa_ptr "void *target" "uintptr_t delta"
+.Ft double
+.Fn ck_pr_faa_double "double *target" "double delta"
+.Ft char
+.Fn ck_pr_faa_char "char *target" "char delta"
+.Ft unsigned int
+.Fn ck_pr_faa_uint "unsigned int *target" "unsigned int delta"
+.Ft int
+.Fn ck_pr_faa_int "int *target" "int delta"
+.Ft uint64_t
+.Fn ck_pr_faa_64 "uint64_t *target" "uint64_t delta"
+.Ft uint32_t
+.Fn ck_pr_faa_32 "uint32_t *target" "uint32_t delta"
+.Ft uint16_t
+.Fn ck_pr_faa_16 "uint16_t *target" "uint16_t delta"
+.Ft uint8_t
+.Fn ck_pr_faa_8 "uint8_t *target" "uint8_t delta"
+.Sh DESCRIPTION
+The
+.Fn ck_pr_faa 3
+family of functions atomically fetch the value pointed to
+by
+.Fa target
+and add the value specified by
+.Fa delta
+to the value pointed to by
+.Fa target .
+.Sh RETURN VALUES
+This function returns the value pointed to by
+.Fa target
+at the time of operation invocation before the
+addition operation is applied.
+.Sh SEE ALSO
+.Xr ck_pr_fence_load 3 ,
+.Xr ck_pr_fence_load_depends 3 ,
+.Xr ck_pr_fence_store 3 ,
+.Xr ck_pr_fence_memory 3 ,
+.Xr ck_pr_load 3 ,
+.Xr ck_pr_store 3 ,
+.Xr ck_pr_fas 3 ,
+.Xr ck_pr_inc 3 ,
+.Xr ck_pr_dec 3 ,
+.Xr ck_pr_neg 3 ,
+.Xr ck_pr_not 3 ,
+.Xr ck_pr_add 3 ,
+.Xr ck_pr_sub 3 ,
+.Xr ck_pr_and 3 ,
+.Xr ck_pr_or 3 ,
+.Xr ck_pr_xor 3 ,
+.Xr ck_pr_cas 3 ,
+.Xr ck_pr_btc 3 ,
+.Xr ck_pr_bts 3 ,
+.Xr ck_pr_btr 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_pr_fas b/doc/ck_pr_fas
new file mode 100644
index 000000000000..037b1044df35
--- /dev/null
+++ b/doc/ck_pr_fas
@@ -0,0 +1,100 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd April 7, 2013
+.Dt ck_pr_fas 3
+.Sh NAME
+.Nm ck_pr_fas_ptr ,
+.Nm ck_pr_fas_double ,
+.Nm ck_pr_fas_char ,
+.Nm ck_pr_fas_uint ,
+.Nm ck_pr_fas_int ,
+.Nm ck_pr_fas_64 ,
+.Nm ck_pr_fas_32 ,
+.Nm ck_pr_fas_16 ,
+.Nm ck_pr_fas_8
+.Nd atomic swap operations
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_pr.h
+.Ft void *
+.Fn ck_pr_fas_ptr "void *target" "void *new_value"
+.Ft double
+.Fn ck_pr_fas_double "double *target" "double new_value"
+.Ft char
+.Fn ck_pr_fas_char "char *target" "char new_value"
+.Ft unsigned int
+.Fn ck_pr_fas_uint "unsigned int *target" "unsigned int new_value"
+.Ft int
+.Fn ck_pr_fas_int "int *target" "int new_value"
+.Ft uint64_t
+.Fn ck_pr_fas_64 "uint64_t *target" "uint64_t new_value"
+.Ft uint32_t
+.Fn ck_pr_fas_32 "uint32_t *target" "uint32_t new_value"
+.Ft uint16_t
+.Fn ck_pr_fas_16 "uint16_t *target" "uint16_t new_value"
+.Ft uint8_t
+.Fn ck_pr_fas_8 "uint8_t *target" "uint8_t new_value"
+.Sh DESCRIPTION
+The
+.Fn ck_pr_fas 3
+family of functions atomically fetch the value pointed to
+by
+.Fa target
+and replace the value pointed to by
+.Fa target
+with the value specified by
+.Fa new_value .
+.Sh RETURN VALUES
+This function returns the value pointed to by
+.Fa target
+at the time of operation invocation before it was
+atomically replaced with
+.Fa new_value .
+.Sh SEE ALSO
+.Xr ck_pr_fence_load 3 ,
+.Xr ck_pr_fence_load_depends 3 ,
+.Xr ck_pr_fence_store 3 ,
+.Xr ck_pr_fence_memory 3 ,
+.Xr ck_pr_load 3 ,
+.Xr ck_pr_store 3 ,
+.Xr ck_pr_faa 3 ,
+.Xr ck_pr_inc 3 ,
+.Xr ck_pr_dec 3 ,
+.Xr ck_pr_neg 3 ,
+.Xr ck_pr_not 3 ,
+.Xr ck_pr_add 3 ,
+.Xr ck_pr_sub 3 ,
+.Xr ck_pr_and 3 ,
+.Xr ck_pr_or 3 ,
+.Xr ck_pr_xor 3 ,
+.Xr ck_pr_cas 3 ,
+.Xr ck_pr_btc 3 ,
+.Xr ck_pr_bts 3 ,
+.Xr ck_pr_btr 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_pr_fence_acquire b/doc/ck_pr_fence_acquire
new file mode 100644
index 000000000000..2d6b9973c6b1
--- /dev/null
+++ b/doc/ck_pr_fence_acquire
@@ -0,0 +1,72 @@
+.\"
+.\" Copyright 2014 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd January 2, 2014
+.Dt CK_PR_FENCE_ACQUIRE 3
+.Sh NAME
+.Nm ck_pr_fence_acquire
+.Nd enforce acquire semantics
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_pr.h
+.Ft void
+.Fn ck_pr_fence_acquire void
+.Sh DESCRIPTION
+This function enforces the partial ordering of any loads prior
+to invocation with respect to any following stores, loads and
+atomic operations. It is typically used to implement critical
+sections.
+.Sh RETURN VALUES
+This function has no return value.
+.Sh SEE ALSO
+.Xr ck_pr_stall 3 ,
+.Xr ck_pr_fence_atomic 3 ,
+.Xr ck_pr_fence_atomic_store 3 ,
+.Xr ck_pr_fence_atomic_load 3 ,
+.Xr ck_pr_fence_release 3 ,
+.Xr ck_pr_fence_store 3 ,
+.Xr ck_pr_fence_memory 3 ,
+.Xr ck_pr_barrier 3 ,
+.Xr ck_pr_fas 3 ,
+.Xr ck_pr_load 3 ,
+.Xr ck_pr_store 3 ,
+.Xr ck_pr_faa 3 ,
+.Xr ck_pr_inc 3 ,
+.Xr ck_pr_dec 3 ,
+.Xr ck_pr_neg 3 ,
+.Xr ck_pr_not 3 ,
+.Xr ck_pr_add 3 ,
+.Xr ck_pr_sub 3 ,
+.Xr ck_pr_and 3 ,
+.Xr ck_pr_or 3 ,
+.Xr ck_pr_xor 3 ,
+.Xr ck_pr_cas 3 ,
+.Xr ck_pr_btc 3 ,
+.Xr ck_pr_bts 3 ,
+.Xr ck_pr_btr 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_pr_fence_atomic b/doc/ck_pr_fence_atomic
new file mode 100644
index 000000000000..06803283e561
--- /dev/null
+++ b/doc/ck_pr_fence_atomic
@@ -0,0 +1,111 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd May 16, 2013
+.Dt CK_PR_FENCE_ATOMIC 3
+.Sh NAME
+.Nm ck_pr_fence_atomic
+.Nd enforce partial ordering of atomic read-modify-write operations
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_pr.h
+.Ft void
+.Fn ck_pr_fence_atomic void
+.Ft void
+.Fn ck_pr_fence_strict_atomic void
+.Sh DESCRIPTION
+The
+.Fn ck_pr_fence_atomic
+function enforces the ordering of any
+atomic read-modify-write operations relative to
+the invocation of the function. This function
+always serve as an implicit compiler barrier. On
+architectures implementing CK_MD_TSO, this operation
+only serves as a compiler barrier and no fences
+are emitted. On architectures implementing
+CK_MD_PSO and CK_MD_RMO, a store fence is
+emitted. To force the unconditional emission of
+a fence, use
+.Fn ck_pr_fence_strict_atomic .
+.Sh EXAMPLE
+.Bd -literal -offset indent
+
+#include <ck_pr.h>
+
+static int a = 0;
+static int b = 0;
+static int c = 0;
+
+void
+function(void)
+{
+
+ ck_pr_fas_int(&a, 1);
+
+ /*
+ * Guarantee that the update to a is completed
+ * with respect to the updates of b and c.
+ */
+ ck_pr_fence_atomic();
+ ck_pr_fas_int(&b, 2);
+ ck_pr_fas_int(&c, 2);
+
+ return;
+}
+.Ed
+.Sh RETURN VALUES
+This function has no return value.
+.Sh SEE ALSO
+.Xr ck_pr_stall 3 ,
+.Xr ck_pr_fence_atomic_store 3 ,
+.Xr ck_pr_fence_atomic_load 3 ,
+.Xr ck_pr_fence_store 3 ,
+.Xr ck_pr_fence_load 3 ,
+.Xr ck_pr_fence_load_atomic 3 ,
+.Xr ck_pr_fence_load_store 3 ,
+.Xr ck_pr_fence_load_depends 3 ,
+.Xr ck_pr_fence_memory 3 ,
+.Xr ck_pr_barrier 3 ,
+.Xr ck_pr_fas 3 ,
+.Xr ck_pr_load 3 ,
+.Xr ck_pr_store 3 ,
+.Xr ck_pr_faa 3 ,
+.Xr ck_pr_inc 3 ,
+.Xr ck_pr_dec 3 ,
+.Xr ck_pr_neg 3 ,
+.Xr ck_pr_not 3 ,
+.Xr ck_pr_add 3 ,
+.Xr ck_pr_sub 3 ,
+.Xr ck_pr_and 3 ,
+.Xr ck_pr_or 3 ,
+.Xr ck_pr_xor 3 ,
+.Xr ck_pr_cas 3 ,
+.Xr ck_pr_btc 3 ,
+.Xr ck_pr_bts 3 ,
+.Xr ck_pr_btr 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_pr_fence_atomic_load b/doc/ck_pr_fence_atomic_load
new file mode 100644
index 000000000000..77675cebc2e7
--- /dev/null
+++ b/doc/ck_pr_fence_atomic_load
@@ -0,0 +1,108 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd May 16, 2013
+.Dt CK_PR_FENCE_ATOMIC_LOAD 3
+.Sh NAME
+.Nm ck_pr_fence_atomic_load
+.Nd enforce ordering of atomic read-modify-write operations to load operations
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_pr.h
+.Ft void
+.Fn ck_pr_fence_atomic_load void
+.Ft void
+.Fn ck_pr_fence_strict_atomic_load void
+.Sh DESCRIPTION
+The
+.Fn ck_pr_fence_atomic_load
+function enforces the ordering of any
+atomic read-modify-write operations relative to
+any load operations following the function invocation. This function
+always serve as an implicit compiler barrier. On
+architectures implementing CK_MD_TSO, this operation
+only serves as a compiler barrier and no fences
+are emitted. To force the unconditional emission of
+a fence, use
+.Fn ck_pr_fence_strict_atomic_load .
+.Sh EXAMPLE
+.Bd -literal -offset indent
+
+#include <ck_pr.h>
+
+static int a = 0;
+static int b = 0;
+
+void
+function(void)
+{
+ int c;
+
+ ck_pr_fas_int(&a, 1);
+
+ /*
+ * Guarantee that the update to a is completed
+ * with respect to the load of *b.
+ */
+ ck_pr_fence_atomic_load();
+ c = ck_pr_load_int(&b);
+
+ return;
+}
+.Ed
+.Sh RETURN VALUES
+This function has no return value.
+.Sh SEE ALSO
+.Xr ck_pr_stall 3 ,
+.Xr ck_pr_fence_atomic 3 ,
+.Xr ck_pr_fence_atomic_store 3 ,
+.Xr ck_pr_fence_store 3 ,
+.Xr ck_pr_fence_load 3 ,
+.Xr ck_pr_fence_load_atomic 3 ,
+.Xr ck_pr_fence_load_store 3 ,
+.Xr ck_pr_fence_load_depends 3 ,
+.Xr ck_pr_fence_memory 3 ,
+.Xr ck_pr_barrier 3 ,
+.Xr ck_pr_fas 3 ,
+.Xr ck_pr_load 3 ,
+.Xr ck_pr_store 3 ,
+.Xr ck_pr_faa 3 ,
+.Xr ck_pr_inc 3 ,
+.Xr ck_pr_dec 3 ,
+.Xr ck_pr_neg 3 ,
+.Xr ck_pr_not 3 ,
+.Xr ck_pr_add 3 ,
+.Xr ck_pr_sub 3 ,
+.Xr ck_pr_and 3 ,
+.Xr ck_pr_or 3 ,
+.Xr ck_pr_xor 3 ,
+.Xr ck_pr_cas 3 ,
+.Xr ck_pr_btc 3 ,
+.Xr ck_pr_bts 3 ,
+.Xr ck_pr_btr 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_pr_fence_atomic_store b/doc/ck_pr_fence_atomic_store
new file mode 100644
index 000000000000..fd02122ea6f7
--- /dev/null
+++ b/doc/ck_pr_fence_atomic_store
@@ -0,0 +1,109 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd May 16, 2013
+.Dt CK_PR_FENCE_ATOMIC_STORE 3
+.Sh NAME
+.Nm ck_pr_fence_atomic_store
+.Nd enforce ordering of atomic read-modify-write operations to store operations
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_pr.h
+.Ft void
+.Fn ck_pr_fence_atomic_store void
+.Ft void
+.Fn ck_pr_fence_strict_atomic_store void
+.Sh DESCRIPTION
+The
+.Fn ck_pr_fence_atomic_store
+function enforces the ordering of any
+atomic read-modify-write operations relative to
+any load operations following the function invocation. This function
+always serve as an implicit compiler barrier. On
+architectures implementing CK_MD_TSO, this operation
+only serves as a compiler barrier and no fences
+are emitted. To force the unconditional emission of
+a fence, use
+.Fn ck_pr_fence_strict_atomic_store .
+.Sh EXAMPLE
+.Bd -literal -offset indent
+
+#include <ck_pr.h>
+
+static int a = 0;
+static int b = 0;
+
+void
+function(void)
+{
+ int c;
+
+ ck_pr_fas_int(&a, 1);
+
+ /*
+ * Guarantee that the update to a is completed
+ * with respect to the store into the value pointed
+ * to by b.
+ */
+ ck_pr_fence_atomic_store();
+ c = ck_pr_store_int(&b, 2);
+
+ return;
+}
+.Ed
+.Sh RETURN VALUES
+This function has no return value.
+.Sh SEE ALSO
+.Xr ck_pr_stall 3 ,
+.Xr ck_pr_fence_atomic 3 ,
+.Xr ck_pr_fence_atomic_load 3 ,
+.Xr ck_pr_fence_store 3 ,
+.Xr ck_pr_fence_load 3 ,
+.Xr ck_pr_fence_load_atomic 3 ,
+.Xr ck_pr_fence_load_store 3 ,
+.Xr ck_pr_fence_load_depends 3 ,
+.Xr ck_pr_fence_memory 3 ,
+.Xr ck_pr_barrier 3 ,
+.Xr ck_pr_fas 3 ,
+.Xr ck_pr_load 3 ,
+.Xr ck_pr_store 3 ,
+.Xr ck_pr_faa 3 ,
+.Xr ck_pr_inc 3 ,
+.Xr ck_pr_dec 3 ,
+.Xr ck_pr_neg 3 ,
+.Xr ck_pr_not 3 ,
+.Xr ck_pr_add 3 ,
+.Xr ck_pr_sub 3 ,
+.Xr ck_pr_and 3 ,
+.Xr ck_pr_or 3 ,
+.Xr ck_pr_xor 3 ,
+.Xr ck_pr_cas 3 ,
+.Xr ck_pr_btc 3 ,
+.Xr ck_pr_bts 3 ,
+.Xr ck_pr_btr 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_pr_fence_load b/doc/ck_pr_fence_load
new file mode 100644
index 000000000000..b6e778df94bd
--- /dev/null
+++ b/doc/ck_pr_fence_load
@@ -0,0 +1,113 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd April 7, 2013
+.Dt ck_pr_fence_load 3
+.Sh NAME
+.Nm ck_pr_fence_load
+.Nd enforce partial ordering of load operations
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_pr.h
+.Ft void
+.Fn ck_pr_fence_load void
+.Ft void
+.Fn ck_pr_fence_strict_load void
+.Sh DESCRIPTION
+This function enforces the ordering of any memory load
+and
+.Fn ck_pr_load 3
+operations relative to the invocation of the function. Any
+store operations that were committed on remote processors
+and received by the calling processor before the invocation of
+.Fn ck_pr_fence_load
+is also be made visible only after a call to
+.Fn ck_pr_fence_load .
+This function always serves as an implicit compiler barrier.
+On architectures with CK_MD_TSO or CK_MD_PSO specified (total store ordering
+and partial store ordering respectively), this operation only serves
+as a compiler barrier and no fence instructions will be emitted. To
+force the unconditional emission of a load fence, use
+.Fn ck_pr_fence_strict_load .
+Architectures implementing CK_MD_RMO always emit a load fence.
+.Sh EXAMPLE
+.Bd -literal -offset indent
+
+#include <ck_pr.h>
+
+static unsigned int a;
+static unsigned int b;
+
+void
+function(void)
+{
+ unsigned int snapshot_a, snapshot_b;
+
+ snapshot_a = ck_pr_load_uint(&a);
+
+ /*
+ * Guarantee that the load from "a" completes
+ * before the load from "b".
+ */
+ ck_pr_fence_load();
+ snapshot_b = ck_pr_load_uint(&b);
+
+ return;
+}
+.Ed
+.Sh RETURN VALUES
+This function has no return value.
+.Sh SEE ALSO
+.Xr ck_pr_stall 3 ,
+.Xr ck_pr_fence_atomic 3 ,
+.Xr ck_pr_fence_atomic_store 3 ,
+.Xr ck_pr_fence_atomic_load 3 ,
+.Xr ck_pr_fence_load_atomic 3 ,
+.Xr ck_pr_fence_load_store 3 ,
+.Xr ck_pr_fence_load_depends 3 ,
+.Xr ck_pr_fence_store 3 ,
+.Xr ck_pr_fence_memory 3 ,
+.Xr ck_pr_barrier 3 ,
+.Xr ck_pr_fas 3 ,
+.Xr ck_pr_load 3 ,
+.Xr ck_pr_store 3 ,
+.Xr ck_pr_faa 3 ,
+.Xr ck_pr_inc 3 ,
+.Xr ck_pr_dec 3 ,
+.Xr ck_pr_neg 3 ,
+.Xr ck_pr_not 3 ,
+.Xr ck_pr_add 3 ,
+.Xr ck_pr_sub 3 ,
+.Xr ck_pr_and 3 ,
+.Xr ck_pr_or 3 ,
+.Xr ck_pr_xor 3 ,
+.Xr ck_pr_cas 3 ,
+.Xr ck_pr_btc 3 ,
+.Xr ck_pr_bts 3 ,
+.Xr ck_pr_btr 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_pr_fence_load_atomic b/doc/ck_pr_fence_load_atomic
new file mode 100644
index 000000000000..c935491055e6
--- /dev/null
+++ b/doc/ck_pr_fence_load_atomic
@@ -0,0 +1,113 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd May 18, 2013
+.Dt CK_PR_FENCE_LOAD_ATOMIC 3
+.Sh NAME
+.Nm ck_pr_fence_load_atomic
+.Nd enforce ordering of load operations to atomic read-modify-write operations
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_pr.h
+.Ft void
+.Fn ck_pr_fence_load_atomic void
+.Ft void
+.Fn ck_pr_fence_strict_load_atomic void
+.Sh DESCRIPTION
+This function enforces the ordering of any memory load
+and
+.Fn ck_pr_load 3
+operations with respect to store operations relative to
+the invocation of the function. Any store operations that
+were committed on remote processors
+and received by the calling processor before the invocation of
+.Fn ck_pr_fence_load_atomic
+is also be made visible only after a call to
+the ck_pr_fence_load family of functions.
+This function always serves as an implicit compiler barrier.
+On architectures with CK_MD_TSO or CK_MD_PSO specified (total store ordering
+and partial store ordering respectively), this operation only serves
+as a compiler barrier and no fence instructions will be emitted. To
+force the unconditional emission of a load fence, use
+.Fn ck_pr_fence_strict_load_atomic .
+Architectures implementing CK_MD_RMO always emit a fence.
+.Sh EXAMPLE
+.Bd -literal -offset indent
+
+#include <ck_pr.h>
+
+static unsigned int a;
+static unsigned int b;
+
+void
+function(void)
+{
+ unsigned int snapshot_a, snapshot_b;
+
+ snapshot_a = ck_pr_load_uint(&a);
+
+ /*
+ * Guarantee that the load from "a" completes
+ * before the update to "b".
+ */
+ ck_pr_fence_load_atomic();
+ ck_pr_fas_uint(&b, 1);
+
+ return;
+}
+.Ed
+.Sh RETURN VALUES
+This function has no return value.
+.Sh SEE ALSO
+.Xr ck_pr_stall 3 ,
+.Xr ck_pr_fence_atomic 3 ,
+.Xr ck_pr_fence_atomic_store 3 ,
+.Xr ck_pr_fence_atomic_load 3 ,
+.Xr ck_pr_fence_load_depends 3 ,
+.Xr ck_pr_fence_load_store 3 ,
+.Xr ck_pr_fence_store 3 ,
+.Xr ck_pr_fence_memory 3 ,
+.Xr ck_pr_barrier 3 ,
+.Xr ck_pr_fas 3 ,
+.Xr ck_pr_load 3 ,
+.Xr ck_pr_store 3 ,
+.Xr ck_pr_faa 3 ,
+.Xr ck_pr_inc 3 ,
+.Xr ck_pr_dec 3 ,
+.Xr ck_pr_neg 3 ,
+.Xr ck_pr_not 3 ,
+.Xr ck_pr_add 3 ,
+.Xr ck_pr_sub 3 ,
+.Xr ck_pr_and 3 ,
+.Xr ck_pr_or 3 ,
+.Xr ck_pr_xor 3 ,
+.Xr ck_pr_cas 3 ,
+.Xr ck_pr_btc 3 ,
+.Xr ck_pr_bts 3 ,
+.Xr ck_pr_btr 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_pr_fence_load_depends b/doc/ck_pr_fence_load_depends
new file mode 100644
index 000000000000..0c0ecfa4ab90
--- /dev/null
+++ b/doc/ck_pr_fence_load_depends
@@ -0,0 +1,75 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd April 7, 2013
+.Dt ck_pr_fence_load_depends 3
+.Sh NAME
+.Nm ck_pr_fence_load_depends
+.Nd data dependency barrier
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_pr.h
+.Ft void
+.Fn ck_pr_fence_load_depends void
+.Sh DESCRIPTION
+The
+.Fn ck_pr_fence_load_depends 3
+emits necessary fences for pure data-dependent loads. It currently only serves as a compiler
+barrier for Concurrency Kit's supported platforms. Unless you're on architecture
+which re-orders data-dependent loads (such as the defunct Alpha), this function is unnecessary.
+.Sh RETURN VALUES
+This function has no return value.
+.Sh SEE ALSO
+.Xr ck_pr_stall 3 ,
+.Xr ck_pr_fence_atomic 3 ,
+.Xr ck_pr_fence_atomic_store 3 ,
+.Xr ck_pr_fence_atomic_load 3 ,
+.Xr ck_pr_fence_load 3 ,
+.Xr ck_pr_fence_load_atomic 3 ,
+.Xr ck_pr_fence_load_store 3 ,
+.Xr ck_pr_fence_store 3 ,
+.Xr ck_pr_fence_memory 3 ,
+.Xr ck_pr_barrier 3 ,
+.Xr ck_pr_fas 3 ,
+.Xr ck_pr_load 3 ,
+.Xr ck_pr_store 3 ,
+.Xr ck_pr_faa 3 ,
+.Xr ck_pr_inc 3 ,
+.Xr ck_pr_dec 3 ,
+.Xr ck_pr_neg 3 ,
+.Xr ck_pr_not 3 ,
+.Xr ck_pr_add 3 ,
+.Xr ck_pr_sub 3 ,
+.Xr ck_pr_and 3 ,
+.Xr ck_pr_or 3 ,
+.Xr ck_pr_xor 3 ,
+.Xr ck_pr_cas 3 ,
+.Xr ck_pr_btc 3 ,
+.Xr ck_pr_bts 3 ,
+.Xr ck_pr_btr 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_pr_fence_load_store b/doc/ck_pr_fence_load_store
new file mode 100644
index 000000000000..4abce996ecbf
--- /dev/null
+++ b/doc/ck_pr_fence_load_store
@@ -0,0 +1,113 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd May 18, 2013
+.Dt CK_PR_FENCE_LOAD_STORE 3
+.Sh NAME
+.Nm ck_pr_fence_load_store
+.Nd enforce ordering of load operations to store operations
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_pr.h
+.Ft void
+.Fn ck_pr_fence_load_store void
+.Ft void
+.Fn ck_pr_fence_strict_load_store void
+.Sh DESCRIPTION
+This function enforces the ordering of any memory load
+and
+.Fn ck_pr_load 3
+operations with respect to store operations relative to
+the invocation of the function. Any store operations that
+were committed on remote processors
+and received by the calling processor before the invocation of
+.Fn ck_pr_fence_load_store
+is also be made visible only after a call to
+the ck_pr_fence_load family of functions.
+This function always serves as an implicit compiler barrier.
+On architectures with CK_MD_TSO or CK_MD_PSO specified (total store ordering
+and partial store ordering respectively), this operation only serves
+as a compiler barrier and no fence instructions will be emitted. To
+force the unconditional emission of a load fence, use
+.Fn ck_pr_fence_strict_load_store .
+Architectures implementing CK_MD_RMO always emit a fence.
+.Sh EXAMPLE
+.Bd -literal -offset indent
+
+#include <ck_pr.h>
+
+static unsigned int a;
+static unsigned int b;
+
+void
+function(void)
+{
+ unsigned int snapshot_a;
+
+ snapshot_a = ck_pr_load_uint(&a);
+
+ /*
+ * Guarantee that the load from "a" completes
+ * before the store to "b".
+ */
+ ck_pr_fence_load_store();
+ ck_pr_store_uint(&b, 1);
+
+ return;
+}
+.Ed
+.Sh RETURN VALUES
+This function has no return value.
+.Sh SEE ALSO
+.Xr ck_pr_stall 3 ,
+.Xr ck_pr_fence_atomic 3 ,
+.Xr ck_pr_fence_atomic_store 3 ,
+.Xr ck_pr_fence_atomic_load 3 ,
+.Xr ck_pr_fence_load_depends 3 ,
+.Xr ck_pr_fence_load_atomic 3 ,
+.Xr ck_pr_fence_store 3 ,
+.Xr ck_pr_fence_memory 3 ,
+.Xr ck_pr_barrier 3 ,
+.Xr ck_pr_fas 3 ,
+.Xr ck_pr_load 3 ,
+.Xr ck_pr_store 3 ,
+.Xr ck_pr_faa 3 ,
+.Xr ck_pr_inc 3 ,
+.Xr ck_pr_dec 3 ,
+.Xr ck_pr_neg 3 ,
+.Xr ck_pr_not 3 ,
+.Xr ck_pr_add 3 ,
+.Xr ck_pr_sub 3 ,
+.Xr ck_pr_and 3 ,
+.Xr ck_pr_or 3 ,
+.Xr ck_pr_xor 3 ,
+.Xr ck_pr_cas 3 ,
+.Xr ck_pr_btc 3 ,
+.Xr ck_pr_bts 3 ,
+.Xr ck_pr_btr 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_pr_fence_memory b/doc/ck_pr_fence_memory
new file mode 100644
index 000000000000..0dfc81b84ec5
--- /dev/null
+++ b/doc/ck_pr_fence_memory
@@ -0,0 +1,113 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd April 7, 2013
+.Dt ck_pr_fence_memory 3
+.Sh NAME
+.Nm ck_pr_fence_memory
+.Nd enforce partial ordering of all memory operations
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_pr.h
+.Ft void
+.Fn ck_pr_fence_memory
+.Ft void
+.Fn ck_pr_fence_strict_memory
+.Sh DESCRIPTION
+The
+.Fn ck_pr_fence_memory 3
+function enforces the ordering of any memory operations
+with respect to the invocation of the function. This function
+always serves as an implicit compiler barrier.
+Achitectures implementing CK_MD_TSO do not emit
+a barrier, but compiler barrier semantics remain.
+Architectures implementing CK_MD_PSO and CK_MD_RMO always emit
+an instructions which provides the specified ordering
+guarantees. To force the unconditional emission of a memory
+fence, use
+.Fn ck_pr_fence_strict_memory .
+.Sh EXAMPLE
+.Bd -literal -offset indent
+
+#include <ck_pr.h>
+
+static int a = 0;
+static int b;
+static int c;
+static int d;
+
+void
+function(void)
+{
+ int snapshot_a;
+
+ ck_pr_store_int(&b, 1);
+ snapshot_a = ck_pr_load_int(&a);
+
+ /*
+ * Make sure previous memory operations are
+ * ordered with respect to memory operations
+ * following the ck_pr_fence_memory.
+ */
+ ck_pr_fence_memory();
+
+ ck_pr_store_int(&d, 3);
+ ck_pr_store_int(&c, 2);
+
+ return;
+}
+.Ed
+.Sh RETURN VALUES
+This function has no return value.
+.Sh SEE ALSO
+.Xr ck_pr_stall 3 ,
+.Xr ck_pr_fence_atomic 3 ,
+.Xr ck_pr_fence_atomic_store 3 ,
+.Xr ck_pr_fence_atomic_load 3 ,
+.Xr ck_pr_fence_load 3 ,
+.Xr ck_pr_fence_load_depends 3 ,
+.Xr ck_pr_fence_store 3 ,
+.Xr ck_pr_barrier 3 ,
+.Xr ck_pr_fas 3 ,
+.Xr ck_pr_load 3 ,
+.Xr ck_pr_store 3 ,
+.Xr ck_pr_faa 3 ,
+.Xr ck_pr_inc 3 ,
+.Xr ck_pr_dec 3 ,
+.Xr ck_pr_neg 3 ,
+.Xr ck_pr_not 3 ,
+.Xr ck_pr_add 3 ,
+.Xr ck_pr_sub 3 ,
+.Xr ck_pr_and 3 ,
+.Xr ck_pr_or 3 ,
+.Xr ck_pr_xor 3 ,
+.Xr ck_pr_cas 3 ,
+.Xr ck_pr_btc 3 ,
+.Xr ck_pr_bts 3 ,
+.Xr ck_pr_btr 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_pr_fence_release b/doc/ck_pr_fence_release
new file mode 100644
index 000000000000..214917cc559f
--- /dev/null
+++ b/doc/ck_pr_fence_release
@@ -0,0 +1,71 @@
+.\"
+.\" Copyright 2014 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd January 2, 2014
+.Dt CK_PR_FENCE_RELEASE 3
+.Sh NAME
+.Nm ck_pr_fence_release
+.Nd enforce release semantics
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_pr.h
+.Ft void
+.Fn ck_pr_fence_release void
+.Sh DESCRIPTION
+This function enforces the partial ordering of any loads prior
+to invocation with respect to any following stores and any stores
+prior to invocation with respect to any following stores.
+.Sh RETURN VALUES
+This function has no return value.
+.Sh SEE ALSO
+.Xr ck_pr_stall 3 ,
+.Xr ck_pr_fence_atomic 3 ,
+.Xr ck_pr_fence_atomic_store 3 ,
+.Xr ck_pr_fence_atomic_load 3 ,
+.Xr ck_pr_fence_acquire 3 ,
+.Xr ck_pr_fence_store 3 ,
+.Xr ck_pr_fence_memory 3 ,
+.Xr ck_pr_barrier 3 ,
+.Xr ck_pr_fas 3 ,
+.Xr ck_pr_load 3 ,
+.Xr ck_pr_store 3 ,
+.Xr ck_pr_faa 3 ,
+.Xr ck_pr_inc 3 ,
+.Xr ck_pr_dec 3 ,
+.Xr ck_pr_neg 3 ,
+.Xr ck_pr_not 3 ,
+.Xr ck_pr_add 3 ,
+.Xr ck_pr_sub 3 ,
+.Xr ck_pr_and 3 ,
+.Xr ck_pr_or 3 ,
+.Xr ck_pr_xor 3 ,
+.Xr ck_pr_cas 3 ,
+.Xr ck_pr_btc 3 ,
+.Xr ck_pr_bts 3 ,
+.Xr ck_pr_btr 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_pr_fence_store b/doc/ck_pr_fence_store
new file mode 100644
index 000000000000..d94e9f1d6f9f
--- /dev/null
+++ b/doc/ck_pr_fence_store
@@ -0,0 +1,112 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd April 7, 2013
+.Dt ck_pr_fence_store 3
+.Sh NAME
+.Nm ck_pr_fence_store
+.Nd enforce partial ordering of store operations
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_pr.h
+.Ft void
+.Fn ck_pr_fence_store void
+.Ft void
+.Fn ck_pr_fence_strict_store void
+.Sh DESCRIPTION
+The
+.Fn ck_pr_fence_store
+function enforces the ordering of any memory store,
+.Fn ck_pr_store
+and atomic read-modify-write operations relative to
+the invocation of the function. This function
+always serve as an implicit compiler barrier. On
+architectures implementing CK_MD_TSO, this operation
+only serves as a compiler barrier and no fences
+are emitted. On architectures implementing
+CK_MD_PSO and CK_MD_RMO, a store fence is
+emitted. To force the unconditional emission of
+a store fence, use
+.Fn ck_pr_fence_strict_store .
+.Sh EXAMPLE
+.Bd -literal -offset indent
+
+#include <ck_pr.h>
+
+static int a = 0;
+static int b = 0;
+static int c = 0;
+
+void
+function(void)
+{
+
+ ck_pr_store_int(&a, 1);
+
+ /*
+ * Guarantee that the store to a is completed
+ * with respect to the stores of b and c.
+ */
+ ck_pr_fence_store();
+ ck_pr_store_int(&b, 2);
+ ck_pr_store_int(&c, 2);
+
+ return;
+}
+.Ed
+.Sh RETURN VALUES
+This function has no return value.
+.Sh SEE ALSO
+.Xr ck_pr_stall 3 ,
+.Xr ck_pr_fence_atomic 3 ,
+.Xr ck_pr_fence_atomic_store 3 ,
+.Xr ck_pr_fence_atomic_load 3 ,
+.Xr ck_pr_fence_load 3 ,
+.Xr ck_pr_fence_load_atomic 3 ,
+.Xr ck_pr_fence_load_store 3 ,
+.Xr ck_pr_fence_load_depends 3 ,
+.Xr ck_pr_fence_memory 3 ,
+.Xr ck_pr_barrier 3 ,
+.Xr ck_pr_fas 3 ,
+.Xr ck_pr_load 3 ,
+.Xr ck_pr_store 3 ,
+.Xr ck_pr_faa 3 ,
+.Xr ck_pr_inc 3 ,
+.Xr ck_pr_dec 3 ,
+.Xr ck_pr_neg 3 ,
+.Xr ck_pr_not 3 ,
+.Xr ck_pr_add 3 ,
+.Xr ck_pr_sub 3 ,
+.Xr ck_pr_and 3 ,
+.Xr ck_pr_or 3 ,
+.Xr ck_pr_xor 3 ,
+.Xr ck_pr_cas 3 ,
+.Xr ck_pr_btc 3 ,
+.Xr ck_pr_bts 3 ,
+.Xr ck_pr_btr 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_pr_fence_store_atomic b/doc/ck_pr_fence_store_atomic
new file mode 100644
index 000000000000..309c80438ab0
--- /dev/null
+++ b/doc/ck_pr_fence_store_atomic
@@ -0,0 +1,108 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd May 18, 2013
+.Dt CK_PR_FENCE_STORE_ATOMIC 3
+.Sh NAME
+.Nm ck_pr_fence_store_atomic
+.Nd enforce ordering of store operations to load operations
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_pr.h
+.Ft void
+.Fn ck_pr_fence_store_atomic void
+.Ft void
+.Fn ck_pr_fence_strict_store_atomic void
+.Sh DESCRIPTION
+The
+.Fn ck_pr_fence_store_atomic
+function enforces the ordering of any memory store,
+.Fn ck_pr_store
+and atomic read-modify-write operations to atomic read-modify-write
+operations relative to the invocation of the function. This function
+always serve as an implicit compiler barrier.
+This functions will emit a fence for PSO and RMO
+targets. In order to force the emission of a fence use the
+.Fn ck_pr_fence_strict_store_atomic
+function.
+.Sh EXAMPLE
+.Bd -literal -offset indent
+
+#include <ck_pr.h>
+
+static int a = 0;
+static int b = 0;
+
+void
+function(void)
+{
+
+ ck_pr_store_int(&a, 1);
+
+ /*
+ * Guarantee that the store to a is completed
+ * with respect to the update of b.
+ */
+ ck_pr_fence_store_atomic();
+ ck_pr_add_int(&b, 2);
+ return;
+}
+.Ed
+.Sh RETURN VALUES
+This function has no return value.
+.Sh SEE ALSO
+.Xr ck_pr_stall 3 ,
+.Xr ck_pr_fence_atomic 3 ,
+.Xr ck_pr_fence_atomic_store 3 ,
+.Xr ck_pr_fence_atomic_load 3 ,
+.Xr ck_pr_fence_load 3 ,
+.Xr ck_pr_fence_load_atomic 3 ,
+.Xr ck_pr_fence_load_store 3 ,
+.Xr ck_pr_fence_load_depends 3 ,
+.Xr ck_pr_fence_store 3 ,
+.Xr ck_pr_fence_store_load 3 ,
+.Xr ck_pr_fence_memory 3 ,
+.Xr ck_pr_barrier 3 ,
+.Xr ck_pr_fas 3 ,
+.Xr ck_pr_load 3 ,
+.Xr ck_pr_store 3 ,
+.Xr ck_pr_faa 3 ,
+.Xr ck_pr_inc 3 ,
+.Xr ck_pr_dec 3 ,
+.Xr ck_pr_neg 3 ,
+.Xr ck_pr_not 3 ,
+.Xr ck_pr_add 3 ,
+.Xr ck_pr_sub 3 ,
+.Xr ck_pr_and 3 ,
+.Xr ck_pr_or 3 ,
+.Xr ck_pr_xor 3 ,
+.Xr ck_pr_cas 3 ,
+.Xr ck_pr_btc 3 ,
+.Xr ck_pr_bts 3 ,
+.Xr ck_pr_btr 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_pr_fence_store_load b/doc/ck_pr_fence_store_load
new file mode 100644
index 000000000000..b595739a57fd
--- /dev/null
+++ b/doc/ck_pr_fence_store_load
@@ -0,0 +1,107 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd May 18, 2013
+.Dt CK_PR_FENCE_STORE_LOAD 3
+.Sh NAME
+.Nm ck_pr_fence_store_load
+.Nd enforce ordering of store operations to load operations
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_pr.h
+.Ft void
+.Fn ck_pr_fence_store_load void
+.Ft void
+.Fn ck_pr_fence_strict_store_load void
+.Sh DESCRIPTION
+The
+.Fn ck_pr_fence_store_load
+function enforces the ordering of any memory store,
+.Fn ck_pr_store
+and atomic read-modify-write operations to load
+operations relative to the invocation of the function. This function
+always serve as an implicit compiler barrier.
+A fence will currently always be emitted for this
+operation, including for TSO memory model targets.
+.Sh EXAMPLE
+.Bd -literal -offset indent
+
+#include <ck_pr.h>
+
+static int a = 0;
+static int b = 0;
+
+void
+function(void)
+{
+ unsigned int snapshot_b;
+
+ ck_pr_store_int(&a, 1);
+
+ /*
+ * Guarantee that the store to a is completed
+ * with respect to load from b.
+ */
+ ck_pr_fence_store_load();
+ snapshot_b = ck_pr_load_int(&b, 2);
+ return;
+}
+.Ed
+.Sh RETURN VALUES
+This function has no return value.
+.Sh SEE ALSO
+.Xr ck_pr_stall 3 ,
+.Xr ck_pr_fence_atomic 3 ,
+.Xr ck_pr_fence_atomic_store 3 ,
+.Xr ck_pr_fence_atomic_load 3 ,
+.Xr ck_pr_fence_load 3 ,
+.Xr ck_pr_fence_load_atomic 3 ,
+.Xr ck_pr_fence_load_store 3 ,
+.Xr ck_pr_fence_load_depends 3 ,
+.Xr ck_pr_fence_store 3 ,
+.Xr ck_pr_fence_store_atomic 3 ,
+.Xr ck_pr_fence_memory 3 ,
+.Xr ck_pr_barrier 3 ,
+.Xr ck_pr_fas 3 ,
+.Xr ck_pr_load 3 ,
+.Xr ck_pr_store 3 ,
+.Xr ck_pr_faa 3 ,
+.Xr ck_pr_inc 3 ,
+.Xr ck_pr_dec 3 ,
+.Xr ck_pr_neg 3 ,
+.Xr ck_pr_not 3 ,
+.Xr ck_pr_add 3 ,
+.Xr ck_pr_sub 3 ,
+.Xr ck_pr_and 3 ,
+.Xr ck_pr_or 3 ,
+.Xr ck_pr_xor 3 ,
+.Xr ck_pr_cas 3 ,
+.Xr ck_pr_btc 3 ,
+.Xr ck_pr_bts 3 ,
+.Xr ck_pr_btr 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_pr_inc b/doc/ck_pr_inc
new file mode 100644
index 000000000000..72a3e7054912
--- /dev/null
+++ b/doc/ck_pr_inc
@@ -0,0 +1,124 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd April 7, 2013
+.Dt ck_pr_inc 3
+.Sh NAME
+.Nm ck_pr_inc_ptr ,
+.Nm ck_pr_inc_ptr_zero ,
+.Nm ck_pr_inc_double ,
+.Nm ck_pr_inc_double_zero ,
+.Nm ck_pr_inc_char ,
+.Nm ck_pr_inc_char_zero ,
+.Nm ck_pr_inc_uint ,
+.Nm ck_pr_inc_uint_zero ,
+.Nm ck_pr_inc_int ,
+.Nm ck_pr_inc_int_zero ,
+.Nm ck_pr_inc_64 ,
+.Nm ck_pr_inc_64_zero ,
+.Nm ck_pr_inc_32 ,
+.Nm ck_pr_inc_32_zero ,
+.Nm ck_pr_inc_16 ,
+.Nm ck_pr_inc_16_zero ,
+.Nm ck_pr_inc_8 ,
+.Nm ck_pr_inc_8_zero
+.Nd atomic increment operations
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_pr.h
+.Ft void
+.Fn ck_pr_inc_ptr "void *target"
+.Ft void
+.Fn ck_pr_inc_ptr_zero "void *target" "bool *z"
+.Ft void
+.Fn ck_pr_inc_double "double *target"
+.Ft void
+.Fn ck_pr_inc_double_zero "double *target" "bool *z"
+.Ft void
+.Fn ck_pr_inc_char "char *target"
+.Ft void
+.Fn ck_pr_inc_char_zero "char *target" "bool *z"
+.Ft void
+.Fn ck_pr_inc_uint "unsigned int *target"
+.Ft void
+.Fn ck_pr_inc_uint_zero "unsigned int *target" "bool *z"
+.Ft void
+.Fn ck_pr_inc_int "int *target"
+.Ft void
+.Fn ck_pr_inc_int_zero "int *target" "bool *z"
+.Ft void
+.Fn ck_pr_inc_64 "uint64_t *target"
+.Ft void
+.Fn ck_pr_inc_64_zero "uint64_t *target" "bool *z"
+.Ft void
+.Fn ck_pr_inc_32 "uint32_t *target"
+.Ft void
+.Fn ck_pr_inc_32_zero "uint32_t *target" "bool *z"
+.Ft void
+.Fn ck_pr_inc_16 "uint16_t *target"
+.Ft void
+.Fn ck_pr_inc_16_zero "uint16_t *target" "bool *z"
+.Ft void
+.Fn ck_pr_inc_8 "uint8_t *target"
+.Ft void
+.Fn ck_pr_inc_8_zero "uint8_t *target" "bool *z"
+.Sh DESCRIPTION
+The
+.Fn ck_pr_inc 3
+family of functions atomically increment the value pointed to
+by
+.Fa target .
+.Sh RETURN VALUES
+The ck_pr_inc_zero family of functions set the value pointed to by
+.Fa z
+to true if the result of the increment operation was 0. The functions set
+the value pointed to by
+.Fa z
+false otherwise.
+.Sh SEE ALSO
+.Xr ck_pr_fence_load 3 ,
+.Xr ck_pr_fence_load_depends 3 ,
+.Xr ck_pr_fence_store 3 ,
+.Xr ck_pr_fence_memory 3 ,
+.Xr ck_pr_load 3 ,
+.Xr ck_pr_store 3 ,
+.Xr ck_pr_fas 3 ,
+.Xr ck_pr_faa 3 ,
+.Xr ck_pr_dec 3 ,
+.Xr ck_pr_neg 3 ,
+.Xr ck_pr_not 3 ,
+.Xr ck_pr_add 3 ,
+.Xr ck_pr_sub 3 ,
+.Xr ck_pr_and 3 ,
+.Xr ck_pr_or 3 ,
+.Xr ck_pr_xor 3 ,
+.Xr ck_pr_cas 3 ,
+.Xr ck_pr_btc 3 ,
+.Xr ck_pr_bts 3 ,
+.Xr ck_pr_btr 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_pr_load b/doc/ck_pr_load
new file mode 100644
index 000000000000..ed615d3523da
--- /dev/null
+++ b/doc/ck_pr_load
@@ -0,0 +1,96 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd April 15, 2013
+.Dt ck_pr_load 3
+.Sh NAME
+.Nm ck_pr_load_ptr ,
+.Nm ck_pr_load_double ,
+.Nm ck_pr_load_uint ,
+.Nm ck_pr_load_int ,
+.Nm ck_pr_load_char ,
+.Nm ck_pr_load_64 ,
+.Nm ck_pr_load_32 ,
+.Nm ck_pr_load_16 ,
+.Nm ck_pr_load_8
+.Nd atomic volatile load operations
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_pr.h
+.Ft void *
+.Fn ck_pr_load_ptr "const void *target"
+.Ft double
+.Fn ck_pr_load_double "const double *target"
+.Ft unsigned int
+.Fn ck_pr_load_uint "const unsigned int *target"
+.Ft int
+.Fn ck_pr_load_int "const int *target"
+.Ft char
+.Fn ck_pr_load_char "const char *target"
+.Ft uint64_t
+.Fn ck_pr_load_64 "const uint64_t *target"
+.Ft uint32_t
+.Fn ck_pr_load_32 "const uint32_t *target"
+.Ft uint16_t
+.Fn ck_pr_load_16 "const uint16_t *target"
+.Ft uint8_t
+.Fn ck_pr_load_8 "const uint8_t *target"
+.Sh DESCRIPTION
+The
+.Fn ck_pr_load 3
+family of functions atomically loads the value
+pointed to by
+.Fa target
+and returns it. This family of functions always
+serves as an implicit compiler barrier and is not
+susceptible to re-ordering by the compiler.
+.Sh RETURN VALUES
+This family of functions returns the value contained
+in the location pointed to by the first argument.
+.Sh SEE ALSO
+.Xr ck_pr_fence_load 3 ,
+.Xr ck_pr_fence_load_depends 3 ,
+.Xr ck_pr_fence_store 3 ,
+.Xr ck_pr_fence_memory 3 ,
+.Xr ck_pr_add 3 ,
+.Xr ck_pr_store 3 ,
+.Xr ck_pr_fas 3 ,
+.Xr ck_pr_faa 3 ,
+.Xr ck_pr_inc 3 ,
+.Xr ck_pr_dec 3 ,
+.Xr ck_pr_neg 3 ,
+.Xr ck_pr_not 3 ,
+.Xr ck_pr_sub 3 ,
+.Xr ck_pr_and 3 ,
+.Xr ck_pr_or 3 ,
+.Xr ck_pr_xor 3 ,
+.Xr ck_pr_cas 3 ,
+.Xr ck_pr_btc 3 ,
+.Xr ck_pr_bts 3 ,
+.Xr ck_pr_btr 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_pr_neg b/doc/ck_pr_neg
new file mode 100644
index 000000000000..38f9a0a10df7
--- /dev/null
+++ b/doc/ck_pr_neg
@@ -0,0 +1,122 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd April 7, 2013
+.Dt ck_pr_neg 3
+.Sh NAME
+.Nm ck_pr_neg_ptr ,
+.Nm ck_pr_neg_ptr_zero ,
+.Nm ck_pr_neg_double ,
+.Nm ck_pr_neg_double_zero ,
+.Nm ck_pr_neg_char ,
+.Nm ck_pr_neg_char_zero ,
+.Nm ck_pr_neg_uint ,
+.Nm ck_pr_neg_uint_zero ,
+.Nm ck_pr_neg_int ,
+.Nm ck_pr_neg_int_zero ,
+.Nm ck_pr_neg_64 ,
+.Nm ck_pr_neg_64_zero ,
+.Nm ck_pr_neg_32 ,
+.Nm ck_pr_neg_32_zero ,
+.Nm ck_pr_neg_16 ,
+.Nm ck_pr_neg_16_zero ,
+.Nm ck_pr_neg_8 ,
+.Nm ck_pr_neg_8_zero
+.Nd atomic negation operations
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_pr.h
+.Ft void
+.Fn ck_pr_neg_ptr "void *target"
+.Ft void
+.Fn ck_pr_neg_ptr_zero "void *target" "bool *z"
+.Ft void
+.Fn ck_pr_neg_double "double *target"
+.Ft void
+.Fn ck_pr_neg_double_zero "double *target" "bool *z"
+.Ft void
+.Fn ck_pr_neg_char "char *target"
+.Ft void
+.Fn ck_pr_neg_char_zero "char *target" "bool *z"
+.Ft void
+.Fn ck_pr_neg_uint "unsigned int *target"
+.Ft void
+.Fn ck_pr_neg_uint_zero "unsigned int *target" "bool *z"
+.Ft void
+.Fn ck_pr_neg_int "int *target"
+.Ft void
+.Fn ck_pr_neg_int_zero "int *target" "bool *z"
+.Ft void
+.Fn ck_pr_neg_64 "uint64_t *target"
+.Ft void
+.Fn ck_pr_neg_64_zero "uint64_t *target" "bool *z"
+.Ft void
+.Fn ck_pr_neg_32 "uint32_t *target"
+.Ft void
+.Fn ck_pr_neg_32_zero "uint32_t *target" "bool *z"
+.Ft void
+.Fn ck_pr_neg_16 "uint16_t *target"
+.Ft void
+.Fn ck_pr_neg_16_zero "uint16_t *target" "bool *z"
+.Ft void
+.Fn ck_pr_neg_8 "uint8_t *target"
+.Ft void
+.Fn ck_pr_neg_8_zero "uint8_t *target" "bool *z"
+.Sh DESCRIPTION
+The
+.Fn ck_pr_neg 3
+family of functions atomically negate the value pointed to
+by
+.Fa target .
+.Sh RETURN VALUES
+The ck_pr_neg_zero functions set the value pointed to by
+.Fa z
+if the result of the negation operation was 0. They set the
+pointed to value to false otherwise.
+.Sh SEE ALSO
+.Xr ck_pr_fence_load 3 ,
+.Xr ck_pr_fence_load_depends 3 ,
+.Xr ck_pr_fence_store 3 ,
+.Xr ck_pr_fence_memory 3 ,
+.Xr ck_pr_load 3 ,
+.Xr ck_pr_store 3 ,
+.Xr ck_pr_fas 3 ,
+.Xr ck_pr_faa 3 ,
+.Xr ck_pr_inc 3 ,
+.Xr ck_pr_dec 3 ,
+.Xr ck_pr_not 3 ,
+.Xr ck_pr_add 3 ,
+.Xr ck_pr_sub 3 ,
+.Xr ck_pr_and 3 ,
+.Xr ck_pr_or 3 ,
+.Xr ck_pr_xor 3 ,
+.Xr ck_pr_cas 3 ,
+.Xr ck_pr_btc 3 ,
+.Xr ck_pr_bts 3 ,
+.Xr ck_pr_btr 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_pr_not b/doc/ck_pr_not
new file mode 100644
index 000000000000..b0a38b254277
--- /dev/null
+++ b/doc/ck_pr_not
@@ -0,0 +1,92 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd April 7, 2013
+.Dt ck_pr_not 3
+.Sh NAME
+.Nm ck_pr_not_ptr ,
+.Nm ck_pr_not_double ,
+.Nm ck_pr_not_char ,
+.Nm ck_pr_not_uint ,
+.Nm ck_pr_not_int ,
+.Nm ck_pr_not_64 ,
+.Nm ck_pr_not_32 ,
+.Nm ck_pr_not_16 ,
+.Nm ck_pr_not_8
+.Nd atomic complement operations
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_pr.h
+.Ft void
+.Fn ck_pr_not_ptr "void *target"
+.Ft void
+.Fn ck_pr_not_double "double *target"
+.Ft void
+.Fn ck_pr_not_char "char *target"
+.Ft void
+.Fn ck_pr_not_uint "unsigned int *target"
+.Ft void
+.Fn ck_pr_not_int "int *target"
+.Ft void
+.Fn ck_pr_not_64 "uint64_t *target"
+.Ft void
+.Fn ck_pr_not_32 "uint32_t *target"
+.Ft void
+.Fn ck_pr_not_16 "uint16_t *target"
+.Ft void
+.Fn ck_pr_not_8 "uint8_t *target"
+.Sh DESCRIPTION
+The
+.Fn ck_pr_not 3
+family of functions atomically complement the value pointed to
+by
+.Fa target .
+.Sh RETURN VALUES
+These functions have no return value.
+.Sh SEE ALSO
+.Xr ck_pr_fence_load 3 ,
+.Xr ck_pr_fence_load_depends 3 ,
+.Xr ck_pr_fence_store 3 ,
+.Xr ck_pr_fence_memory 3 ,
+.Xr ck_pr_load 3 ,
+.Xr ck_pr_store 3 ,
+.Xr ck_pr_fas 3 ,
+.Xr ck_pr_faa 3 ,
+.Xr ck_pr_inc 3 ,
+.Xr ck_pr_not 3 ,
+.Xr ck_pr_neg 3 ,
+.Xr ck_pr_add 3 ,
+.Xr ck_pr_sub 3 ,
+.Xr ck_pr_and 3 ,
+.Xr ck_pr_or 3 ,
+.Xr ck_pr_xor 3 ,
+.Xr ck_pr_cas 3 ,
+.Xr ck_pr_btc 3 ,
+.Xr ck_pr_bts 3 ,
+.Xr ck_pr_btr 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_pr_or b/doc/ck_pr_or
new file mode 100644
index 000000000000..2a68330a99fe
--- /dev/null
+++ b/doc/ck_pr_or
@@ -0,0 +1,93 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd April 11, 2013
+.Dt ck_pr_or 3
+.Sh NAME
+.Nm ck_pr_or_ptr ,
+.Nm ck_pr_or_char ,
+.Nm ck_pr_or_uint ,
+.Nm ck_pr_or_int ,
+.Nm ck_pr_or_64 ,
+.Nm ck_pr_or_32 ,
+.Nm ck_pr_or_16 ,
+.Nm ck_pr_or_8
+.Nd atomic bitwise-or operations
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_pr.h
+.Ft void
+.Fn ck_pr_or_ptr "void *target" "uintptr_t delta"
+.Ft void
+.Fn ck_pr_or_char "char *target" "char delta"
+.Ft void
+.Fn ck_pr_or_uint "unsigned int *target" "unsigned int delta"
+.Ft void
+.Fn ck_pr_or_int "int *target" "int delta"
+.Ft void
+.Fn ck_pr_or_64 "uint64_t *target" "uint64_t delta"
+.Ft void
+.Fn ck_pr_or_32 "uint32_t *target" "uint32_t delta"
+.Ft void
+.Fn ck_pr_or_16 "uint16_t *target" "uint16_t delta"
+.Ft void
+.Fn ck_pr_or_8 "uint8_t *target" "uint8_t delta"
+.Sh DESCRIPTION
+The
+.Fn ck_pr_or 3
+family of functions atomically compute and store the
+result of a bitwise-or of the value pointed to by
+.Fa target
+and
+.Fa delta
+into the value pointed to by
+.Fa target .
+.Sh RETURN VALUES
+This family of functions does not have a return value.
+.Sh SEE ALSO
+.Xr ck_pr_fence_load 3 ,
+.Xr ck_pr_fence_load_depends 3 ,
+.Xr ck_pr_fence_store 3 ,
+.Xr ck_pr_fence_memory 3 ,
+.Xr ck_pr_load 3 ,
+.Xr ck_pr_store 3 ,
+.Xr ck_pr_fas 3 ,
+.Xr ck_pr_faa 3 ,
+.Xr ck_pr_inc 3 ,
+.Xr ck_pr_dec 3 ,
+.Xr ck_pr_neg 3 ,
+.Xr ck_pr_not 3 ,
+.Xr ck_pr_add 3 ,
+.Xr ck_pr_sub 3 ,
+.Xr ck_pr_xor 3 ,
+.Xr ck_pr_and 3 ,
+.Xr ck_pr_cas 3 ,
+.Xr ck_pr_btc 3 ,
+.Xr ck_pr_bts 3 ,
+.Xr ck_pr_btr 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_pr_rtm b/doc/ck_pr_rtm
new file mode 100644
index 000000000000..53c31b60f41e
--- /dev/null
+++ b/doc/ck_pr_rtm
@@ -0,0 +1,112 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd December 17, 2013
+.Dt ck_pr_rtm 3
+.Sh NAME
+.Nm ck_pr_rtm_begin ,
+.Nm ck_pr_rtm_end ,
+.Nm ck_pr_rtm_abort ,
+.Nm ck_pr_rtm_test
+.Nd restricted transactional memory
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_pr.h
+.Ft unsigned int
+.Fn ck_pr_rtm_begin "void"
+.Ft void
+.Fn ck_pr_rtm_end "void"
+.Ft void
+.Fn ck_pr_rtm_abort "const unsigned int status"
+.Ft bool
+.Fn ck_pr_rtm_test "void"
+.Sh DESCRIPTION
+These family of functions implement support for restricted
+transactional memory, if available on the underlying platform.
+Currently, support is only provided for Intel Haswell and
+newer x86 microarchitectures that have the TSX-NI feature.
+.Pp
+The
+.Fn ck_pr_rtm_begin
+function returns CK_PR_RTM_STARTED if a transaction was successfully
+started. In case of an abort, either internal (through a ck_pr_rtm_abort)
+or external, program flow will return to the point which the function
+was called except the return value will consist of a bitmap with one or
+more of the following bits set:
+.Bl -tag -width indent
+.It CK_PR_RTM_EXPLICIT
+Set if the transactionally was explicitly aborted through
+.Fn ck_pr_rtm_abort .
+.It CK_PR_RTM_RETRY
+Set if the transaction failed but can still succeed if
+retried.
+.It CK_PR_RTM_CONFLICT
+The transaction failed due to a conflict in one of the memory
+addresses that are part of the working set of the transaction.
+.It CK_PR_RTM_CAPACITY
+Set if the architecture-defined transaction size limit was exceeded.
+.It CK_PR_RTM_DEBUG
+Set if a hardware breakpoint was triggered.
+.It CK_PR_RTM_NESTED
+Set if a nested transaction failed.
+.El
+.Pp
+The user is also able to specify a one byte abort status
+by calling
+.Fn ck_pr_rtm_abort .
+This status byte can be extracted by calling the
+.Fn CK_PR_RTM_CODE
+function with the return value of
+.Fn ck_pr_rtm_begin
+as an argument. The return value of
+.Fn CK_PR_RTM_CODE
+will be the value of this status byte.
+For additional information, please see the Intel instruction
+set manuals.
+.Sh SEE ALSO
+.Xr ck_pr_fence_load 3 ,
+.Xr ck_pr_fence_load_depends 3 ,
+.Xr ck_pr_fence_store 3 ,
+.Xr ck_pr_fence_memory 3 ,
+.Xr ck_pr_load 3 ,
+.Xr ck_pr_store 3 ,
+.Xr ck_pr_fas 3 ,
+.Xr ck_pr_faa 3 ,
+.Xr ck_pr_inc 3 ,
+.Xr ck_pr_dec 3 ,
+.Xr ck_pr_neg 3 ,
+.Xr ck_pr_not 3 ,
+.Xr ck_pr_sub 3 ,
+.Xr ck_pr_and 3 ,
+.Xr ck_pr_or 3 ,
+.Xr ck_pr_xor 3 ,
+.Xr ck_pr_add 3 ,
+.Xr ck_pr_btc 3 ,
+.Xr ck_pr_bts 3 ,
+.Xr ck_pr_btr 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_pr_stall b/doc/ck_pr_stall
new file mode 100644
index 000000000000..bc46647c483b
--- /dev/null
+++ b/doc/ck_pr_stall
@@ -0,0 +1,86 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd April 7, 2013
+.Dt ck_pr_stall 3
+.Sh NAME
+.Nm ck_pr_stall
+.Nd busy-wait primitive
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_pr.h
+.Ft void
+.Fn ck_pr_stall void
+.Sh DESCRIPTION
+The
+.Fn ck_pr_stall 3
+function should be used inside retry paths of busy-wait loops.
+It not only serves as a compiler barrier, but on some architectures
+it emits cycle-saving instructions.
+.Sh EXAMPLE
+.Bd -literal -offset indent
+
+#include <ck_pr.h>
+
+static int ready = 0;
+
+void
+function(void)
+{
+
+ /* Busy-wait until ready is non-zero. */
+ while (ck_pr_load_int(&ready) == 0)
+ ck_pr_stall();
+
+ return;
+}
+.Ed
+.Sh SEE ALSO
+.Xr ck_pr_fence_load 3 ,
+.Xr ck_pr_fence_load_depends 3 ,
+.Xr ck_pr_fence_store 3 ,
+.Xr ck_pr_fence_memory 3 ,
+.Xr ck_pr_barrier 3 ,
+.Xr ck_pr_fas 3 ,
+.Xr ck_pr_load 3 ,
+.Xr ck_pr_store 3 ,
+.Xr ck_pr_faa 3 ,
+.Xr ck_pr_inc 3 ,
+.Xr ck_pr_dec 3 ,
+.Xr ck_pr_neg 3 ,
+.Xr ck_pr_not 3 ,
+.Xr ck_pr_add 3 ,
+.Xr ck_pr_sub 3 ,
+.Xr ck_pr_and 3 ,
+.Xr ck_pr_or 3 ,
+.Xr ck_pr_xor 3 ,
+.Xr ck_pr_cas 3 ,
+.Xr ck_pr_btc 3 ,
+.Xr ck_pr_bts 3 ,
+.Xr ck_pr_btr 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_pr_store b/doc/ck_pr_store
new file mode 100644
index 000000000000..462cf7b7c250
--- /dev/null
+++ b/doc/ck_pr_store
@@ -0,0 +1,96 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd April 15, 2013
+.Dt ck_pr_store 3
+.Sh NAME
+.Nm ck_pr_store_ptr ,
+.Nm ck_pr_store_double ,
+.Nm ck_pr_store_uint ,
+.Nm ck_pr_store_int ,
+.Nm ck_pr_store_char ,
+.Nm ck_pr_store_64 ,
+.Nm ck_pr_store_32 ,
+.Nm ck_pr_store_16 ,
+.Nm ck_pr_store_8
+.Nd atomic volatile store operations
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_pr.h
+.Ft void
+.Fn ck_pr_store_ptr "void *target" "void *value"
+.Ft void
+.Fn ck_pr_store_double "double *target" "double value"
+.Ft void
+.Fn ck_pr_store_uint "unsigned int *target" "unsigned int value"
+.Ft void
+.Fn ck_pr_store_int "int *target" "int value"
+.Ft void
+.Fn ck_pr_store_char "char *target" "char value"
+.Ft void
+.Fn ck_pr_store_64 "uint64_t *target" "uint64_t value"
+.Ft void
+.Fn ck_pr_store_32 "uint32_t *target" "uint32_t value"
+.Ft void
+.Fn ck_pr_store_16 "uint16_t *target" "uint16_t value"
+.Ft void
+.Fn ck_pr_store_8 "uint8_t *target" "uint8_t value"
+.Sh DESCRIPTION
+The
+.Fn ck_pr_store 3
+family of functions atomically stores the value specified
+by
+.Fa value
+into the location pointed to by
+.Fa target .
+This family of functions always serves as an implicit compiler
+barrier and is not susceptible to compiler re-ordering.
+.Sh RETURN VALUES
+This family of functions has no return value.
+.Sh SEE ALSO
+.Xr ck_pr_fence_load 3 ,
+.Xr ck_pr_fence_load_depends 3 ,
+.Xr ck_pr_fence_store 3 ,
+.Xr ck_pr_fence_memory 3 ,
+.Xr ck_pr_add 3 ,
+.Xr ck_pr_load 3 ,
+.Xr ck_pr_fas 3 ,
+.Xr ck_pr_faa 3 ,
+.Xr ck_pr_inc 3 ,
+.Xr ck_pr_dec 3 ,
+.Xr ck_pr_neg 3 ,
+.Xr ck_pr_not 3 ,
+.Xr ck_pr_sub 3 ,
+.Xr ck_pr_and 3 ,
+.Xr ck_pr_or 3 ,
+.Xr ck_pr_xor 3 ,
+.Xr ck_pr_cas 3 ,
+.Xr ck_pr_btc 3 ,
+.Xr ck_pr_bts 3 ,
+.Xr ck_pr_btr 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_pr_sub b/doc/ck_pr_sub
new file mode 100644
index 000000000000..5eee17040353
--- /dev/null
+++ b/doc/ck_pr_sub
@@ -0,0 +1,93 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd April 11, 2013
+.Dt ck_pr_sub 3
+.Sh NAME
+.Nm ck_pr_sub_ptr ,
+.Nm ck_pr_sub_double ,
+.Nm ck_pr_sub_char ,
+.Nm ck_pr_sub_uint ,
+.Nm ck_pr_sub_int ,
+.Nm ck_pr_sub_64 ,
+.Nm ck_pr_sub_32 ,
+.Nm ck_pr_sub_16 ,
+.Nm ck_pr_sub_8
+.Nd atomic subtraction operations
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_pr.h
+.Ft void
+.Fn ck_pr_sub_ptr "void *target" "uintptr_t delta"
+.Ft void
+.Fn ck_pr_sub_double "double *target" "double delta"
+.Ft void
+.Fn ck_pr_sub_char "char *target" "char delta"
+.Ft void
+.Fn ck_pr_sub_uint "unsigned int *target" "unsigned int delta"
+.Ft void
+.Fn ck_pr_sub_int "int *target" "int delta"
+.Ft void
+.Fn ck_pr_sub_64 "uint64_t *target" "uint64_t delta"
+.Ft void
+.Fn ck_pr_sub_32 "uint32_t *target" "uint32_t delta"
+.Ft void
+.Fn ck_pr_sub_16 "uint16_t *target" "uint16_t delta"
+.Ft void
+.Fn ck_pr_sub_8 "uint8_t *target" "uint8_t delta"
+.Sh DESCRIPTION
+The
+.Fn ck_pr_sub 3
+family of functions atomically subtract the value specified by
+.Fa delta
+from the value pointed to by
+.Fa target .
+.Sh RETURN VALUES
+This family of functions does not have a return value.
+.Sh SEE ALSO
+.Xr ck_pr_fence_load 3 ,
+.Xr ck_pr_fence_load_depends 3 ,
+.Xr ck_pr_fence_store 3 ,
+.Xr ck_pr_fence_memory 3 ,
+.Xr ck_pr_load 3 ,
+.Xr ck_pr_store 3 ,
+.Xr ck_pr_fas 3 ,
+.Xr ck_pr_faa 3 ,
+.Xr ck_pr_inc 3 ,
+.Xr ck_pr_dec 3 ,
+.Xr ck_pr_neg 3 ,
+.Xr ck_pr_not 3 ,
+.Xr ck_pr_add 3 ,
+.Xr ck_pr_and 3 ,
+.Xr ck_pr_or 3 ,
+.Xr ck_pr_xor 3 ,
+.Xr ck_pr_cas 3 ,
+.Xr ck_pr_btc 3 ,
+.Xr ck_pr_bts 3 ,
+.Xr ck_pr_btr 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_pr_xor b/doc/ck_pr_xor
new file mode 100644
index 000000000000..509f60dd22ce
--- /dev/null
+++ b/doc/ck_pr_xor
@@ -0,0 +1,93 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd April 11, 2013
+.Dt ck_pr_xor 3
+.Sh NAME
+.Nm ck_pr_xor_ptr ,
+.Nm ck_pr_xor_char ,
+.Nm ck_pr_xor_uint ,
+.Nm ck_pr_xor_int ,
+.Nm ck_pr_xor_64 ,
+.Nm ck_pr_xor_32 ,
+.Nm ck_pr_xor_16 ,
+.Nm ck_pr_xor_8
+.Nd atomic bitwise-xor operations
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_pr.h
+.Ft void
+.Fn ck_pr_xor_ptr "void *target" "uintptr_t delta"
+.Ft void
+.Fn ck_pr_xor_char "char *target" "char delta"
+.Ft void
+.Fn ck_pr_xor_uint "unsigned int *target" "unsigned int delta"
+.Ft void
+.Fn ck_pr_xor_int "int *target" "int delta"
+.Ft void
+.Fn ck_pr_xor_64 "uint64_t *target" "uint64_t delta"
+.Ft void
+.Fn ck_pr_xor_32 "uint32_t *target" "uint32_t delta"
+.Ft void
+.Fn ck_pr_xor_16 "uint16_t *target" "uint16_t delta"
+.Ft void
+.Fn ck_pr_xor_8 "uint8_t *target" "uint8_t delta"
+.Sh DESCRIPTION
+The
+.Fn ck_pr_xor 3
+family of functions atomically compute and store the
+result of a bitwise-xor of the value pointed to by
+.Fa target
+and
+.Fa delta
+into the value pointed to by
+.Fa target .
+.Sh RETURN VALUES
+This family of functions does not have a return value.
+.Sh SEE ALSO
+.Xr ck_pr_fence_load 3 ,
+.Xr ck_pr_fence_load_depends 3 ,
+.Xr ck_pr_fence_store 3 ,
+.Xr ck_pr_fence_memory 3 ,
+.Xr ck_pr_load 3 ,
+.Xr ck_pr_store 3 ,
+.Xr ck_pr_fas 3 ,
+.Xr ck_pr_faa 3 ,
+.Xr ck_pr_inc 3 ,
+.Xr ck_pr_dec 3 ,
+.Xr ck_pr_neg 3 ,
+.Xr ck_pr_not 3 ,
+.Xr ck_pr_add 3 ,
+.Xr ck_pr_sub 3 ,
+.Xr ck_pr_or 3 ,
+.Xr ck_pr_and 3 ,
+.Xr ck_pr_cas 3 ,
+.Xr ck_pr_btc 3 ,
+.Xr ck_pr_bts 3 ,
+.Xr ck_pr_btr 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_queue b/doc/ck_queue
new file mode 100644
index 000000000000..a27ec15c582a
--- /dev/null
+++ b/doc/ck_queue
@@ -0,0 +1,147 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd July 28, 2013.
+.Dt ck_queue 3
+.Sh NAME
+.Nm CK_LIST_EMPTY ,
+.Nm CK_LIST_ENTRY ,
+.Nm CK_LIST_FIRST ,
+.Nm CK_LIST_FOREACH ,
+.Nm CK_LIST_FOREACH_SAFE ,
+.Nm CK_LIST_HEAD ,
+.Nm CK_LIST_HEAD_INITIALIZER ,
+.Nm CK_LIST_INIT ,
+.Nm CK_LIST_INSERT_AFTER ,
+.Nm CK_LIST_INSERT_BEFORE ,
+.Nm CK_LIST_INSERT_HEAD ,
+.Nm CK_LIST_MOVE ,
+.Nm CK_LIST_NEXT ,
+.Nm CK_LIST_REMOVE ,
+.Nm CK_LIST_SWAP ,
+.Nm CK_SLIST_EMPTY ,
+.Nm CK_SLIST_ENTRY ,
+.Nm CK_SLIST_FIRST ,
+.Nm CK_SLIST_FOREACH ,
+.Nm CK_SLIST_FOREACH_PREVPTR ,
+.Nm CK_SLIST_FOREACH_SAFE ,
+.Nm CK_SLIST_HEAD ,
+.Nm CK_SLIST_HEAD_INITIALIZER ,
+.Nm CK_SLIST_INIT ,
+.Nm CK_SLIST_INSERT_AFTER ,
+.Nm CK_SLIST_INSERT_HEAD ,
+.Nm CK_SLIST_MOVE ,
+.Nm CK_SLIST_NEXT ,
+.Nm CK_SLIST_REMOVE ,
+.Nm CK_SLIST_REMOVE_AFTER ,
+.Nm CK_SLIST_REMOVE_HEAD ,
+.Nm CK_SLIST_SWAP ,
+.Nm CK_STAILQ_CONCAT ,
+.Nm CK_STAILQ_EMPTY ,
+.Nm CK_STAILQ_ENTRY ,
+.Nm CK_STAILQ_FIRST ,
+.Nm CK_STAILQ_FOREACH ,
+.Nm CK_STAILQ_FOREACH_SAFE ,
+.Nm CK_STAILQ_HEAD ,
+.Nm CK_STAILQ_HEAD_INITIALIZER ,
+.Nm CK_STAILQ_INIT ,
+.Nm CK_STAILQ_INSERT_AFTER ,
+.Nm CK_STAILQ_INSERT_HEAD ,
+.Nm CK_STAILQ_INSERT_TAIL ,
+.Nm CK_STAILQ_MOVE ,
+.Nm CK_STAILQ_NEXT ,
+.Nm CK_STAILQ_REMOVE ,
+.Nm CK_STAILQ_REMOVE_AFTER ,
+.Nm CK_STAILQ_REMOVE_HEAD ,
+.Nm CK_STAILQ_SWAP
+.Nd multi-reader single-writer singly-linked lists, singly-linked tail queues and lists
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_queue.h
+.Fn CK_LIST_EMPTY
+.Fn CK_LIST_ENTRY
+.Fn CK_LIST_FIRST
+.Fn CK_LIST_FOREACH
+.Fn CK_LIST_FOREACH_SAFE
+.Fn CK_LIST_HEAD
+.Fn CK_LIST_HEAD_INITIALIZER
+.Fn CK_LIST_INIT
+.Fn CK_LIST_INSERT_AFTER
+.Fn CK_LIST_INSERT_BEFORE
+.Fn CK_LIST_INSERT_HEAD
+.Fn CK_LIST_MOVE
+.Fn CK_LIST_NEXT
+.Fn CK_LIST_REMOVE
+.Fn CK_LIST_SWAP
+.Fn CK_SLIST_EMPTY
+.Fn CK_SLIST_ENTRY
+.Fn CK_SLIST_FIRST
+.Fn CK_SLIST_FOREACH
+.Fn CK_SLIST_FOREACH_PREVPTR
+.Fn CK_SLIST_FOREACH_SAFE
+.Fn CK_SLIST_HEAD
+.Fn CK_SLIST_HEAD_INITIALIZER
+.Fn CK_SLIST_INIT
+.Fn CK_SLIST_INSERT_AFTER
+.Fn CK_SLIST_INSERT_HEAD
+.Fn CK_SLIST_MOVE
+.Fn CK_SLIST_NEXT
+.Fn CK_SLIST_REMOVE
+.Fn CK_SLIST_REMOVE_AFTER
+.Fn CK_SLIST_REMOVE_HEAD
+.Fn CK_SLIST_SWAP
+.Fn CK_STAILQ_CONCAT
+.Fn CK_STAILQ_EMPTY
+.Fn CK_STAILQ_ENTRY
+.Fn CK_STAILQ_FIRST
+.Fn CK_STAILQ_FOREACH
+.Fn CK_STAILQ_FOREACH_SAFE
+.Fn CK_STAILQ_HEAD
+.Fn CK_STAILQ_HEAD_INITIALIZER
+.Fn CK_STAILQ_INIT
+.Fn CK_STAILQ_INSERT_AFTER
+.Fn CK_STAILQ_INSERT_HEAD
+.Fn CK_STAILQ_INSERT_TAIL
+.Fn CK_STAILQ_MOVE
+.Fn CK_STAILQ_NEXT
+.Fn CK_STAILQ_REMOVE
+.Fn CK_STAILQ_REMOVE_AFTER
+.Fn CK_STAILQ_REMOVE_HEAD
+.Fn CK_STAILQ_SWAP
+.Sh DESCRIPTION
+See your system's manual page for
+.Xr queue
+for additional information. ck_queue is a queue.h-compatible
+implementation of many-reader-single-writer queues. It allows
+for safe concurrent iteration, peeking and read-side access
+in the presence of a single concurrent writer without any
+usage of locks. In many cases, adoption of ck_queue will
+simply require prefixing all queue operations with CK_.
+.Sh SEE ALSO
+.Xr queue
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_rhs_apply b/doc/ck_rhs_apply
new file mode 100644
index 000000000000..80b1da7bd696
--- /dev/null
+++ b/doc/ck_rhs_apply
@@ -0,0 +1,86 @@
+.\"
+.\" Copyright 2014 Samy Al Bahra.
+.\" Copyright 2014 Backtrace I/O, Inc.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd September 1, 2014
+.Dt CK_RHS_APPLY 3
+.Sh NAME
+.Nm ck_rhs_apply
+.Nd apply a function to hash set value
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_rhs.h
+.Ft void *
+.Fn ck_rhs_apply_fn_t "void *key" "void *closure"
+.Ft bool
+.Fn ck_rhs_apply "ck_rhs_t *hs" "unsigned long hash" "const void *key" "ck_rhs_apply_fn_t *function" "void *argument"
+.Sh DESCRIPTION
+The
+.Fn ck_rhs_apply 3
+function will lookup the hash set slot associated with
+.Fa key
+and pass it to function pointed to by
+.Fa function
+for further action. This callback may remove or replace
+the value by respectively returning NULL or a pointer to
+another object with an identical key. The first argument
+passed to
+.Fa function
+is a pointer to the object found in the hash set and
+the second argument is the
+.Fa argument
+pointer passed to
+.Fn ck_rhs_apply 3 .
+If the pointer returned by
+.Fa function
+is equivalent to the first argument then no modification
+is made to the hash set.
+.Sh RETURN VALUES
+Upon successful completion,
+.Fn ck_rhs_apply 3
+returns true and otherwise returns false on failure.
+.Sh SEE ALSO
+.Xr ck_rhs_init 3 ,
+.Xr ck_rhs_move 3 ,
+.Xr ck_rhs_destroy 3 ,
+.Xr ck_rhs_fas 3 ,
+.Xr CK_RHS_HASH 3 ,
+.Xr ck_rhs_iterator_init 3 ,
+.Xr ck_rhs_next 3 ,
+.Xr ck_rhs_get 3 ,
+.Xr ck_rhs_put 3 ,
+.Xr ck_rhs_put_unique 3 ,
+.Xr ck_rhs_remove 3 ,
+.Xr ck_rhs_grow 3 ,
+.Xr ck_rhs_rebuild 3 ,
+.Xr ck_rhs_gc 3 ,
+.Xr ck_rhs_count 3 ,
+.Xr ck_rhs_reset 3 ,
+.Xr ck_rhs_reset_size 3 ,
+.Xr ck_rhs_stat 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_rhs_count b/doc/ck_rhs_count
new file mode 100644
index 000000000000..3a42b1200bcf
--- /dev/null
+++ b/doc/ck_rhs_count
@@ -0,0 +1,70 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd September 17, 2012
+.Dt CK_RHS_COUNT 3
+.Sh NAME
+.Nm ck_rhs_count
+.Nd returns number of entries in hash set
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_rhs.h
+.Ft unsigned long
+.Fn ck_rhs_count "ck_rhs_t *hs"
+.Sh DESCRIPTION
+The
+.Fn ck_rhs_count 3
+function returns the number of keys currently
+stored in
+.Fa hs .
+.Sh ERRORS
+Behavior is undefined if
+.Fa hs
+is uninitialized. Behavior is
+undefined if this function is called by a non-writer
+thread.
+.Sh SEE ALSO
+.Xr ck_rhs_init 3 ,
+.Xr ck_rhs_move 3 ,
+.Xr ck_rhs_destroy 3 ,
+.Xr CK_RHS_HASH 3 ,
+.Xr ck_rhs_iterator_init 3 ,
+.Xr ck_rhs_next 3 ,
+.Xr ck_rhs_get 3 ,
+.Xr ck_rhs_put 3 ,
+.Xr ck_rhs_put_unique 3 ,
+.Xr ck_rhs_set 3 ,
+.Xr ck_rhs_fas 3 ,
+.Xr ck_rhs_remove 3 ,
+.Xr ck_rhs_grow 3 ,
+.Xr ck_rhs_rebuild 3 ,
+.Xr ck_rhs_gc 3 ,
+.Xr ck_rhs_reset 3 ,
+.Xr ck_rhs_reset_size 3 ,
+.Xr ck_rhs_stat 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_rhs_destroy b/doc/ck_rhs_destroy
new file mode 100644
index 000000000000..68de27e2417e
--- /dev/null
+++ b/doc/ck_rhs_destroy
@@ -0,0 +1,77 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd September 17, 2012
+.Dt CK_RHS_DESTROY 3
+.Sh NAME
+.Nm ck_rhs_destroy
+.Nd destroy hash set
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_rhs.h
+.Ft void
+.Fn ck_rhs_destroy "ck_rhs_t *hs"
+.Sh DESCRIPTION
+The
+.Fn ck_rhs_destroy 3
+function will request that the underlying allocator, as specified by the
+.Xr ck_rhs_init 3
+function, immediately destroy the object pointed to by the
+.Fa hs
+argument.
+The user must guarantee that no threads are accessing the object pointed to
+by
+.Fa hs
+when
+.Fn ck_rhs_destroy 3
+is called.
+.Sh RETURN VALUES
+.Fn ck_rhs_destroy 3
+has no return value.
+.Sh ERRORS
+This function is guaranteed not to fail.
+.Sh SEE ALSO
+.Xr ck_rhs_init 3 ,
+.Xr ck_rhs_move 3 ,
+.Xr CK_RHS_HASH 3 ,
+.Xr ck_rhs_iterator_init 3 ,
+.Xr ck_rhs_next 3 ,
+.Xr ck_rhs_get 3 ,
+.Xr ck_rhs_put 3 ,
+.Xr ck_rhs_put_unique 3 ,
+.Xr ck_rhs_set 3 ,
+.Xr ck_rhs_fas 3 ,
+.Xr ck_rhs_remove 3 ,
+.Xr ck_rhs_grow 3 ,
+.Xr ck_rhs_rebuild 3 ,
+.Xr ck_rhs_gc 3 ,
+.Xr ck_rhs_count 3 ,
+.Xr ck_rhs_reset 3 ,
+.Xr ck_rhs_reset_size 3 ,
+.Xr ck_rhs_stat 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_rhs_fas b/doc/ck_rhs_fas
new file mode 100644
index 000000000000..453c40ba283f
--- /dev/null
+++ b/doc/ck_rhs_fas
@@ -0,0 +1,98 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd June 20, 2013
+.Dt CK_RHS_FAS 3
+.Sh NAME
+.Nm ck_rhs_fas
+.Nd fetch and store key in hash set
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_rhs.h
+.Ft bool
+.Fn ck_rhs_fas "ck_rhs_t *hs" "unsigned long hash" "const void *key" "void **previous"
+.Sh DESCRIPTION
+The
+.Fn ck_rhs_fas 3
+function will fetch and store the key specified by the
+.Fa key
+argument in the hash set pointed to by the
+.Fa hs
+argument. The key specified by
+.Fa key
+is expected to have the hash value specified by the
+.Fa hash
+argument (which was previously generated using the
+.Xr CK_RHS_HASH 3
+macro).
+.Pp
+If the call to
+.Fn ck_rhs_fas 3
+was successful then the key specified by
+.Fa key
+was successfully stored in the hash set pointed to by
+.Fa hs .
+The key must already exist in the hash set, and is
+replaced by
+.Fa key
+and the previous value is stored into the void pointer
+pointed to by the
+.Fa previous
+argument. If the key does not exist in the hash set
+then the function will return false and the hash set
+is unchanged. This function
+is guaranteed to be stable with respect to memory usage.
+.Sh RETURN VALUES
+Upon successful completion,
+.Fn ck_rhs_fas 3
+returns true and otherwise returns false on failure.
+.Sh ERRORS
+Behavior is undefined if
+.Fa key
+or
+.Fa hs
+are uninitialized.
+.Sh SEE ALSO
+.Xr ck_rhs_init 3 ,
+.Xr ck_rhs_move 3 ,
+.Xr ck_rhs_destroy 3 ,
+.Xr CK_RHS_HASH 3 ,
+.Xr ck_rhs_iterator_init 3 ,
+.Xr ck_rhs_next 3 ,
+.Xr ck_rhs_get 3 ,
+.Xr ck_rhs_put 3 ,
+.Xr ck_rhs_put_unique 3 ,
+.Xr ck_rhs_remove 3 ,
+.Xr ck_rhs_grow 3 ,
+.Xr ck_rhs_rebuild 3 ,
+.Xr ck_rhs_gc 3 ,
+.Xr ck_rhs_count 3 ,
+.Xr ck_rhs_reset 3 ,
+.Xr ck_rhs_reset_size 3 ,
+.Xr ck_rhs_stat 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_rhs_gc b/doc/ck_rhs_gc
new file mode 100644
index 000000000000..0ad532463f07
--- /dev/null
+++ b/doc/ck_rhs_gc
@@ -0,0 +1,73 @@
+.\"
+.\" Copyright 2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd December 17, 2013
+.Dt CK_RHS_GC 3
+.Sh NAME
+.Nm ck_rhs_gc
+.Nd perform maintenance on a hash set
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_rhs.h
+.Ft bool
+.Fn ck_rhs_gc "ck_rhs_t *hs"
+.Sh DESCRIPTION
+The
+.Fn ck_rhs_gc 3
+function will perform various maintenance routines on the hash set
+pointed to by
+.Fa hs ,
+including recalculating the maximum number of probes.
+.Sh RETURN VALUES
+Upon successful completion,
+.Fn ck_rhs_gc 3
+returns true and otherwise returns false on failure due to memory allocation
+failure.
+.Sh ERRORS
+This function will only return false if there are internal memory allocation
+failures.
+.Sh SEE ALSO
+.Xr ck_rhs_init 3 ,
+.Xr ck_rhs_move 3 ,
+.Xr ck_rhs_destroy 3 ,
+.Xr CK_RHS_HASH 3 ,
+.Xr ck_rhs_iterator_init 3 ,
+.Xr ck_rhs_next 3 ,
+.Xr ck_rhs_get 3 ,
+.Xr ck_rhs_put 3 ,
+.Xr ck_rhs_put_unique 3 ,
+.Xr ck_rhs_grow 3 ,
+.Xr ck_rhs_rebuild 3 ,
+.Xr ck_rhs_set 3 ,
+.Xr ck_rhs_fas 3 ,
+.Xr ck_rhs_remove 3 ,
+.Xr ck_rhs_count 3 ,
+.Xr ck_rhs_reset 3 ,
+.Xr ck_rhs_reset_size 3 ,
+.Xr ck_rhs_stat 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_rhs_get b/doc/ck_rhs_get
new file mode 100644
index 000000000000..51c6e2f439ac
--- /dev/null
+++ b/doc/ck_rhs_get
@@ -0,0 +1,88 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"
+.Dd September 17, 2012
+.Dt CK_RHS_GET 3
+.Sh NAME
+.Nm ck_rhs_get
+.Nd load a key from a hash set
+.Sh LIBRARY
+Concurrency Kit (libck, \-lck)
+.Sh SYNOPSIS
+.In ck_rhs.h
+.Ft void *
+.Fn ck_rhs_get "ck_rhs_t *hs" "unsigned long hash" "const void *key"
+.Sh DESCRIPTION
+The
+.Fn ck_rhs_get 3
+function will return a pointer to a key in the hash set
+.Fa hs
+that is of equivalent value to the object pointed to by
+.Fa key .
+The key specified by
+.Fa key
+is expected to have the hash value specified by the
+.Fa hash
+argument (which is to have been previously generated using the
+.Xr CK_RHS_HASH 3
+macro).
+.Sh RETURN VALUES
+If the provided key is a member of
+.Fa hs
+then a pointer to the key as stored in
+.Fa hs
+is returned. If the key was not found in
+.Fa hs
+then a value of
+.Dv NULL
+is returned.
+.Sh ERRORS
+Behavior is undefined if
+.Fa entry
+or
+.Fa hs
+are uninitialized.
+.Sh SEE ALSO
+.Xr ck_rhs_init 3 ,
+.Xr ck_rhs_move 3 ,
+.Xr ck_rhs_destroy 3 ,
+.Xr CK_RHS_HASH 3 ,
+.Xr ck_rhs_iterator_init 3 ,
+.Xr ck_rhs_next 3 ,
+.Xr ck_rhs_put 3 ,
+.Xr ck_rhs_put_unique 3 ,
+.Xr ck_rhs_set 3 ,
+.Xr ck_rhs_fas 3 ,
+.Xr ck_rhs_remove 3 ,
+.Xr ck_rhs_grow 3 ,
+.Xr ck_rhs_rebuild 3 ,
+.Xr ck_rhs_gc 3 ,
+.Xr ck_rhs_count 3 ,
+.Xr ck_rhs_reset 3 ,
+.Xr ck_rhs_reset_size 3 ,
+.Xr ck_rhs_stat 3
+.Pp
+Additional information available at http://concurrencykit.org/
diff --git a/doc/ck_rhs_grow b/doc/ck_rhs_grow
new file mode 100644
index 000000000000..f1cac2649543
--- /dev/null
+++ b/doc/ck_rhs_grow
@@ -0,0 +1,81 @@
+.\"
+.\" Copyright 2012-2013 Samy Al Bahra.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION