Merge branch 'master' of https://github.com/concurrencykit/ck
commit
d2c297deed
@ -0,0 +1 @@
|
||||
|
@ -1 +1,2 @@
|
||||
CFLAGS+=-m64 -D__ppc64__
|
||||
LDFLAGS+=-m64
|
||||
|
@ -1 +1,2 @@
|
||||
CFLAGS+=-m32 -D__x86__ -msse -msse2
|
||||
LDFLAGS+=-m32
|
||||
|
@ -1 +1,2 @@
|
||||
CFLAGS+=-m64 -D__x86_64__
|
||||
LDFLAGS+=-m64
|
||||
|
@ -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/
|
@ -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/
|
@ -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/
|
@ -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/
|
@ -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/
|
@ -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/
|
@ -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/
|
@ -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/
|
@ -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/
|
@ -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_RHS_GROW 3
|
||||
.Sh NAME
|
||||
.Nm ck_rhs_grow
|
||||
.Nd enlarge hash set capacity
|
||||
.Sh LIBRARY
|
||||
Concurrency Kit (libck, \-lck)
|
||||
.Sh SYNOPSIS
|
||||
.In ck_rhs.h
|
||||
.Ft bool
|
||||
.Fn ck_rhs_grow "ck_rhs_t *hs" "unsigned long capacity"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Fn ck_rhs_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_rhs 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_rhs_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_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_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/
|
@ -0,0 +1,166 @@
|
||||
.\"
|
||||
.\" 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_INIT 3
|
||||
.Sh NAME
|
||||
.Nm ck_rhs_init
|
||||
.Nd initialize a hash set
|
||||
.Sh LIBRARY
|
||||
Concurrency Kit (libck, \-lck)
|
||||
.Sh SYNOPSIS
|
||||
.In ck_rhs.h
|
||||
.Ft typedef unsigned long
|
||||
.Fn ck_rhs_hash_cb_t "const void *key" "unsigned long seed"
|
||||
.Ft typedef bool
|
||||
.Fn ck_rhs_compare_cb_t "const void *c1" "const void *c2"
|
||||
.Ft bool
|
||||
.Fn ck_rhs_init "ck_rhs_t *hs" "unsigned int mode" "ck_rhs_hash_cb_t *hash_function" "ck_rhs_compare_cb_t *compare" "struct ck_malloc *allocator" "unsigned long capacity" "unsigned long seed"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Fn ck_rhs_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_RHS_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_RHS_MODE_DIRECT
|
||||
The hash set is meant to directly store key values and that all
|
||||
bits of the key are used to encode values.
|
||||
.It CK_RHS_MODE_READ_MOSTLY
|
||||
Optimize read operations over put/delete.
|
||||
.El
|
||||
.Pp
|
||||
The concurrent access model is specified by:
|
||||
.Bl -tag -width indent
|
||||
.It CK_RHS_MODE_SPMC
|
||||
The hash set should allow for concurrent readers in the
|
||||
presence of a single writer.
|
||||
.It CK_RHS_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
|
||||
.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_rhs_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_rhs_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_rhs_init
|
||||
is undefined if
|
||||
.Fa hs
|
||||
is not a pointer to a
|
||||
.Tn ck_rhs_t
|
||||
object.
|
||||
.El
|
||||
.Sh SEE ALSO
|
||||
.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_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/
|
@ -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_RHS_ITERATOR_INIT 3
|
||||
.Sh NAME
|
||||
.Nm ck_rhs_iterator_init
|
||||
.Nd initialize hash set iterator
|
||||
.Sh LIBRARY
|
||||
Concurrency Kit (libck, \-lck)
|
||||
.Sh SYNOPSIS
|
||||
.In ck_rhs.h
|
||||
.Pp
|
||||
.Dv ck_rhs_iterator_t iterator = CK_RHS_ITERATOR_INITIALIZER
|
||||
.Pp
|
||||
.Ft void
|
||||
.Fn ck_rhs_iterator_init "ck_rhs_iterator_t *iterator"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Fn ck_rhs_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_RHS_ITERATOR_INITIALIZER value.
|
||||
.Pp
|
||||
An iterator is used to iterate through hash set entries with the
|
||||
.Xr ck_rhs_next 3
|
||||
function.
|
||||
.Sh RETURN VALUES
|
||||
.Fn ck_rhs_iterator_init 3
|
||||
has no return value.
|
||||
.Sh ERRORS
|
||||
This function will not fail.
|
||||
.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_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/
|
@ -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_RHS_MOVE 3
|
||||
.Sh NAME
|
||||
.Nm ck_rhs_move
|
||||
.Nd move one from hash set to another
|
||||
.Sh LIBRARY
|
||||
Concurrency Kit (libck, \-lck)
|
||||
.Sh SYNOPSIS
|
||||
.In ck_rhs.h
|
||||
.Ft bool
|
||||
.Fn ck_rhs_move "ck_rhs_t *destination" "ck_rhs_t *source" "ck_rhs_hash_cb_t *hash_cb" "ck_rhs_compare_cb_t *compare_cb" "struct ck_malloc *m"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Fn ck_rhs_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_rhs_get 3
|
||||
and
|
||||
.Xr ck_rhs_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_rhs_move 3
|
||||
returns true and otherwise returns false to indicate an error.
|
||||
.Sh SEE ALSO
|
||||
.Xr ck_rhs_init 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/
|
@ -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_RHS_NEXT 3
|
||||
.Sh NAME
|
||||
.Nm ck_rhs_next
|
||||
.Nd iterate to next entry in hash set
|
||||
.Sh LIBRARY
|
||||
Concurrency Kit (libck, \-lck)
|
||||
.Sh SYNOPSIS
|
||||
.In ck_rhs.h
|
||||
.Ft bool
|
||||
.Fn ck_rhs_next "ck_rhs_t *hs" "ck_rhs_iterator_t *iterator" "void **entry"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Fn ck_rhs_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_rhs_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_rhs_iterator_init 3
|
||||
function or statically initialized using CK_RHS_ITERATOR_INITIALIZER.
|
||||
.Sh RETURN VALUES
|
||||
If
|
||||
.Fn ck_rhs_next 3
|
||||
returns true then the object pointed to by
|
||||
.Fa entry
|
||||
points to a valid hash set key. If
|
||||
.Fn ck_rhs_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_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_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/
|
@ -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_RHS_PUT 3
|
||||
.Sh NAME
|
||||
.Nm ck_rhs_put
|
||||
.Nd store unique key into a hash set
|
||||
.Sh LIBRARY
|
||||
Concurrency Kit (libck, \-lck)
|
||||
.Sh SYNOPSIS
|
||||
.In ck_rhs.h
|
||||
.Ft bool
|
||||
.Fn ck_rhs_put "ck_rhs_t *hs" "unsigned long hash" "const void *key"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Fn ck_rhs_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_RHS_HASH 3
|
||||
macro).
|
||||
.Pp
|
||||
If the call to
|
||||
.Fn ck_rhs_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_rhs_set 3
|
||||
function.
|
||||
.Sh RETURN VALUES
|
||||
Upon successful completion,
|
||||
.Fn ck_rhs_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_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_unique 3 ,
|
||||
.Xr ck_rhs_get 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/
|
@ -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_RHS_PUT_UNIQUE 3
|
||||
.Sh NAME
|
||||
.Nm ck_rhs_put_unique
|
||||
.Nd unconditionally store unique key into a hash set
|
||||
.Sh LIBRARY
|
||||
Concurrency Kit (libck, \-lck)
|
||||
.Sh SYNOPSIS
|
||||
.In ck_rhs.h
|
||||
.Ft bool
|
||||
.Fn ck_rhs_put_unique "ck_rhs_t *hs" "unsigned long hash" "const void *key"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Fn ck_rhs_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_RHS_HASH 3
|
||||
macro).
|
||||
.Pp
|
||||
If the call to
|
||||
.Fn ck_rhs_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_rhs_set 3
|
||||
function.
|
||||
.Sh RETURN VALUES
|
||||
Upon successful completion,
|
||||
.Fn ck_rhs_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_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_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/
|
@ -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_RHS_REBUILD 3
|
||||
.Sh NAME
|
||||
.Nm ck_rhs_rebuild
|
||||
.Nd rebuild a hash set
|
||||
.Sh LIBRARY
|
||||
Concurrency Kit (libck, \-lck)
|
||||
.Sh SYNOPSIS
|
||||
.In ck_rhs.h
|
||||
.Ft bool
|
||||
.Fn ck_rhs_rebuild "ck_rhs_t *hs"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Fn ck_rhs_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_rhs_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_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_gc 3 ,
|
||||
.Xr ck_rhs_grow 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/
|
@ -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_RHS_REMOVE 3
|
||||
.Sh NAME
|
||||
.Nm ck_rhs_remove
|
||||
.Nd remove key from a hash set
|
||||
.Sh LIBRARY
|
||||
Concurrency Kit (libck, \-lck)
|
||||
.Sh SYNOPSIS
|
||||
.In ck_rhs.h
|
||||
.Ft void *
|
||||
.Fn ck_rhs_remove "ck_rhs_t *hs" "unsigned long hash" "const void *key"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Fn ck_rhs_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_RHS_HASH 3
|
||||
macro).
|
||||
.Pp
|
||||
If the call to
|
||||
.Fn ck_rhs_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_rhs_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_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_grow 3 ,
|
||||
.Xr ck_rhs_gc 3 ,
|
||||
.Xr ck_rhs_rebuild 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/
|
@ -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_RESET 3
|
||||
.Sh NAME
|
||||
.Nm ck_rhs_reset
|
||||
.Nd remove all keys from a hash set
|
||||
.Sh LIBRARY
|
||||
Concurrency Kit (libck, \-lck)
|
||||
.Sh SYNOPSIS
|
||||
.In ck_rhs.h
|
||||
.Ft bool
|
||||
.Fn ck_rhs_reset "ck_rhs_t *hs"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Fn ck_rhs_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_rhs_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_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_reset_size 3 ,
|
||||
.Xr ck_rhs_grow 3 ,
|
||||
.Xr ck_rhs_gc 3 ,
|
||||
.Xr ck_rhs_rebuild 3 ,
|
||||
.Xr ck_rhs_count 3 ,
|
||||
.Xr ck_rhs_stat 3
|
||||
.Pp
|
||||
Additional information available at http://concurrencykit.org/
|
@ -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_RHS_RESET_SIZE 3
|
||||
.Sh NAME
|
||||
.Nm ck_rhs_reset_size
|
||||
.Nd remove all keys from a hash set
|
||||
.Sh LIBRARY
|
||||
Concurrency Kit (libck, \-lck)
|
||||
.Sh SYNOPSIS
|
||||
.In ck_rhs.h
|
||||
.Ft bool
|
||||
.Fn ck_rhs_reset_size "ck_rhs_t *hs" "unsigned long size"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Fn ck_rhs_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_rhs_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_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_gc 3 ,
|
||||
.Xr ck_rhs_rebuild 3 ,
|
||||
.Xr ck_rhs_count 3 ,
|
||||
.Xr ck_rhs_reset 3 ,
|
||||
.Xr ck_rhs_stat 3
|
||||
.Pp
|
||||
Additional information available at http://concurrencykit.org/
|
@ -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_RHS_SET 3
|
||||
.Sh NAME
|
||||
.Nm ck_rhs_set
|
||||
.Nd store key into a hash set
|
||||
.Sh LIBRARY
|
||||
Concurrency Kit (libck, \-lck)
|
||||
.Sh SYNOPSIS
|
||||
.In ck_rhs.h
|
||||
.Ft bool
|
||||
.Fn ck_rhs_set "ck_rhs_t *hs" "unsigned long hash" "const void *key" "void **previous"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Fn ck_rhs_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_RHS_HASH 3
|
||||
macro).
|
||||
.Pp
|
||||
If the call to
|
||||
.Fn ck_rhs_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_rhs_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_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_fas 3 ,
|
||||
.Xr ck_rhs_remove 3 ,
|
||||
.Xr ck_rhs_grow 3 ,
|
||||
.Xr ck_rhs_gc 3 ,
|
||||
.Xr ck_rhs_rebuild 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/
|
@ -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 September 17, 2012
|
||||
.Dt CK_RHS_STAT 3
|
||||
.Sh NAME
|
||||
.Nm ck_rhs_stat
|
||||
.Nd get hash set status
|
||||
.Sh LIBRARY
|
||||
Concurrency Kit (libck, \-lck)
|
||||
.Sh SYNOPSIS
|
||||
.In ck_rhs.h
|
||||
.Ft void
|
||||
.Fn ck_rhs_stat "ck_rhs_t *hs" "struct ck_rhs_stat *st"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Fn ck_rhs_stat 3
|
||||
function will store various hash set statistics in
|
||||
the object pointed to by
|
||||
.Fa st .
|
||||
The ck_rhs_stat structure is defined as follows:
|
||||
.Bd -literal -offset indent
|
||||
struct ck_rhs_stat {
|
||||
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_rhs_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_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_gc 3 ,
|
||||
.Xr ck_rhs_rebuild 3 ,
|
||||
.Xr ck_rhs_count 3 ,
|
||||
.Xr ck_rhs_reset 3 ,
|
||||
.Xr ck_rhs_reset_size 3
|
||||
.Pp
|
||||
Additional information available at http://concurrencykit.org/
|
@ -0,0 +1,64 @@
|
||||
/*
|
||||
* 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 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.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ck_epoch.h>
|
||||
|
||||
#include "../../common.h"
|
||||
|
||||
static ck_epoch_t epoch;
|
||||
static unsigned int counter;
|
||||
static ck_epoch_record_t record[2];
|
||||
|
||||
static void
|
||||
cb(ck_epoch_entry_t *p)
|
||||
{
|
||||
|
||||
if (counter == 0)
|
||||
ck_epoch_call(&epoch, &record[1], p, cb);
|
||||
|
||||
printf("Counter value: %u -> %u\n",
|
||||
counter, counter + 1);
|
||||
counter++;
|
||||
return;
|
||||
}
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
ck_epoch_entry_t entry;
|
||||
|
||||
ck_epoch_register(&epoch, &record[0]);
|
||||
ck_epoch_register(&epoch, &record[1]);
|
||||
|
||||
ck_epoch_call(&epoch, &record[1], &entry, cb);
|
||||
ck_epoch_barrier(&epoch, &record[1]);
|
||||
ck_epoch_barrier(&epoch, &record[1]);
|
||||
if (counter != 2)
|
||||
ck_error("Expected counter value 2, read %u.\n", counter);
|
||||
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,260 @@
|
||||
/*
|
||||
* 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 copyrighs
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyrighs
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <ck_hs.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <ck_malloc.h>
|
||||
#include <errno.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "../../common.h"
|
||||
#include "../../../src/ck_ht_hash.h"
|
||||
|
||||
static ck_hs_t hs;
|
||||
static char **keys;
|
||||
static size_t keys_length = 0;
|
||||
static size_t keys_capacity = 128;
|
||||
static unsigned long global_seed;
|
||||
|
||||
static void *
|
||||
hs_malloc(size_t r)
|
||||
{
|
||||
|
||||
return malloc(r);
|
||||
}
|
||||
|
||||
static void
|
||||
hs_free(void *p, size_t b, bool r)
|
||||
{
|
||||
|
||||
(void)b;
|
||||
(void)r;
|
||||
|
||||
free(p);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static struct ck_malloc my_allocator = {
|
||||
.malloc = hs_malloc,
|
||||
.free = hs_free
|
||||
};
|
||||
|
||||
static unsigned long
|
||||
hs_hash(const void *object, unsigned long seed)
|
||||
{
|
||||
const char *c = object;
|
||||
unsigned long h;
|
||||
|
||||
h = (unsigned long)MurmurHash64A(c, strlen(c), seed);
|
||||
return h;
|
||||
}
|
||||
|
||||
static bool
|
||||
hs_compare(const void *previous, const void *compare)
|
||||
{
|
||||
|
||||
return strcmp(previous, compare) == 0;
|
||||
}
|
||||
|
||||
static void
|
||||
set_destroy(void)
|
||||
{
|
||||
|
||||
ck_hs_destroy(&hs);
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
set_init(unsigned int size, unsigned int mode)
|
||||
{
|
||||
|
||||
if (ck_hs_init(&hs, CK_HS_MODE_OBJECT | CK_HS_MODE_SPMC | mode, hs_hash, hs_compare,
|
||||
&my_allocator, size, global_seed) == false) {
|
||||
perror("ck_hs_init");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static size_t
|
||||
set_count(void)
|
||||
{
|
||||
|
||||
return ck_hs_count(&hs);
|
||||
}
|
||||
|
||||
static bool
|
||||
set_reset(void)
|
||||
{
|
||||
|
||||
return ck_hs_reset(&hs);
|
||||
}
|
||||
|
||||
static void *
|
||||
test_apply(void *key, void *closure)
|
||||
{
|
||||
|
||||
(void)key;
|
||||
|
||||
return closure;
|
||||
}
|
||||
|
||||
static void
|
||||
run_test(const char *file, size_t r, unsigned int size, unsigned int mode)
|
||||
{
|
||||
FILE *fp;
|
||||
char buffer[512];
|
||||
size_t i, j;
|
||||
unsigned int d = 0;
|
||||
uint64_t s, e, a, gp, agp;
|
||||
struct ck_hs_stat st;
|
||||
char **t;
|
||||
|
||||
keys = malloc(sizeof(char *) * keys_capacity);
|
||||
assert(keys != NULL);
|
||||
|
||||
fp = fopen(file, "r");
|
||||
assert(fp != NULL);
|
||||
|
||||
while (fgets(buffer, sizeof(buffer), fp) != NULL) {
|
||||
buffer[strlen(buffer) - 1] = '\0';
|
||||
keys[keys_length++] = strdup(buffer);
|
||||
assert(keys[keys_length - 1] != NULL);
|
||||
|
||||
if (keys_length == keys_capacity) {
|
||||
t = realloc(keys, sizeof(char *) * (keys_capacity *= 2));
|
||||
assert(t != NULL);
|
||||
keys = t;
|
||||
}
|
||||
}
|
||||
|
||||
t = realloc(keys, sizeof(char *) * keys_length);
|
||||
assert(t != NULL);
|
||||
keys = t;
|
||||
|
||||
set_init(size, mode);
|
||||
for (i = 0; i < keys_length; i++) {
|
||||
unsigned long h = CK_HS_HASH(&hs, hs_hash, keys[i]);
|
||||
|
||||
if (ck_hs_get(&hs, h, keys[i]) == false) {
|
||||
if (ck_hs_put(&hs, h, keys[i]) == false)
|
||||
ck_error("ERROR: Failed get to put workload.\n");
|
||||
} else {
|
||||
d++;
|
||||
}
|
||||
}
|
||||
ck_hs_stat(&hs, &st);
|
||||
|
||||
fprintf(stderr, "# %zu entries stored, %u duplicates, %u probe.\n",
|
||||
set_count(), d, st.probe_maximum);
|
||||
|
||||
a = 0;
|
||||
for (j = 0; j < r; j++) {
|
||||
if (set_reset() == false)
|
||||
ck_error("ERROR: Failed to reset hash table.\n");
|
||||
|
||||
s = rdtsc();
|
||||
for (i = 0; i < keys_length; i++) {
|
||||
unsigned long h = CK_HS_HASH(&hs, hs_hash, keys[i]);
|
||||
|
||||
if (ck_hs_get(&hs, h, keys[i]) == false &&
|
||||
ck_hs_put(&hs, h, keys[i]) == false) {
|
||||
ck_error("ERROR: Failed get to put workload.\n");
|
||||
}
|
||||
}
|
||||
e = rdtsc();
|
||||
a += e - s;
|
||||
}
|
||||
gp = a / (r * keys_length);
|
||||
|
||||
a = 0;
|
||||
for (j = 0; j < r; j++) {
|
||||
if (set_reset() == false)
|
||||
ck_error("ERROR: Failed to reset hash table.\n");
|
||||
|
||||
s = rdtsc();
|
||||
for (i = 0; i < keys_length; i++) {
|
||||
unsigned long h = CK_HS_HASH(&hs, hs_hash, keys[i]);
|
||||
|
||||
if (ck_hs_apply(&hs, h, keys[i], test_apply, (void *)keys[i]) == false)
|
||||
ck_error("ERROR: Failed in apply workload.\n");
|
||||
}
|
||||
e = rdtsc();
|
||||
a += e - s;
|
||||
}
|
||||
agp = a / (r * keys_length);
|
||||
|
||||
fclose(fp);
|
||||
|
||||
for (i = 0; i < keys_length; i++) {
|
||||
free(keys[i]);
|
||||
}
|
||||
|
||||
printf("Get to put: %" PRIu64 " ticks\n", gp);
|
||||
printf(" Apply: %" PRIu64 " ticks\n", agp);
|
||||
|
||||
free(keys);
|
||||
keys_length = 0;
|
||||
set_destroy();
|
||||
return;
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
unsigned int r, size;
|
||||
|
||||
common_srand48((long int)time(NULL));
|
||||
if (argc < 2) {
|
||||
ck_error("Usage: ck_hs <dictionary> [<repetitions> <initial size>]\n");
|
||||
}
|
||||
|
||||
r = 16;
|
||||
if (argc >= 3)
|
||||
r = atoi(argv[2]);
|
||||
|
||||
size = 8;
|
||||
if (argc >= 4)
|
||||
size = atoi(argv[3]);
|
||||
|
||||
global_seed = common_lrand48();
|
||||
run_test(argv[1], r, size, 0);
|
||||
|
||||
printf("\n==============================================\n"
|
||||
"Delete mode\n"
|
||||
"==============================================\n");
|
||||
run_test(argv[1], r, size, CK_HS_MODE_DELETE);
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in new issue