-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfraser.h
41 lines (38 loc) · 1.37 KB
/
fraser.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
* File:
* fraser.h
* Author(s):
* Vincent Gramoli <[email protected]>
* Description:
* Lock-based skip list implementation of the Fraser algorithm
* "Practical Lock Freedom", K. Fraser,
* PhD dissertation, September 2003
* Cambridge University Technical Report UCAM-CL-TR-579
*
* Copyright (c) 2009-2010.
*
* fraser.h is part of Synchrobench
*
* Synchrobench is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation, version 2
* of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef FRASER_H_
#define FRASER_H_
#include "skiplist.h"
#include "ssalloc.h"
int fraser_find(sl_intset_t *set, slkey_t key, val_t *val);
int fraser_remove(sl_intset_t *set, slkey_t key, val_t *val, int remove_succ);
int fraser_insert(sl_intset_t *set, slkey_t key, val_t v);
inline int is_marked(uintptr_t i);
inline uintptr_t unset_mark(uintptr_t i);
inline uintptr_t set_mark(uintptr_t i);
inline void fraser_search(sl_intset_t *set, slkey_t key, sl_node_t **left_list, sl_node_t **right_list);
inline void mark_node_ptrs(sl_node_t *n);
#endif // FRASER_H_