#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
#ifndef CONCURRENT_TREE_H
#define CONCURRENT_TREE_H
#include<ft/comparator.h>
#include"treenode.h"
#include"keyrange.h"
namespacetoku{
// A concurrent_tree stores non-overlapping ranges.
// Access to disjoint parts of the tree usually occurs concurrently.
classconcurrent_tree{
public:
// A locked_keyrange gives you exclusive access to read and write
// operations that occur on any keys in that range. You only have
// the right to operate on keys in that range or keys that were read
// from the keyrange using iterate()
//
// Access model:
// - user prepares a locked keyrange. all threads serialize behind prepare().
// - user breaks the serialzation point by acquiring a range, or releasing.
// - one thread operates on a certain locked_keyrange object at a time.
// - when the thread is finished, it releases
classlocked_keyrange{
public:
// effect: prepare to acquire a locked keyrange over the given
// concurrent_tree, preventing other threads from preparing
// until this thread either does acquire() or release().