usermode/library/mtm/src/mtm.c

Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2011 Computer Sciences Department, 
00003     University of Wisconsin -- Madison
00004 
00005     ----------------------------------------------------------------------
00006 
00007     This file is part of Mnemosyne: Lightweight Persistent Memory, 
00008     originally developed at the University of Wisconsin -- Madison.
00009 
00010     Mnemosyne was originally developed primarily by Haris Volos
00011     with contributions from Andres Jaan Tack.
00012 
00013     ----------------------------------------------------------------------
00014 
00015     Mnemosyne is free software; you can redistribute it and/or
00016     modify it under the terms of the GNU General Public License
00017     as published by the Free Software Foundation, version 2
00018     of the License.
00019  
00020     Mnemosyne is distributed in the hope that it will be useful,
00021     but WITHOUT ANY WARRANTY; without even the implied warranty of
00022     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023     GNU General Public License for more details.
00024 
00025     You should have received a copy of the GNU General Public License
00026     along with this program; if not, write to the Free Software
00027     Foundation, Inc., 51 Franklin Street, Fifth Floor, 
00028     Boston, MA  02110-1301, USA.
00029 
00030 ### END HEADER ###
00031 */
00032 
00040 #include <mtm_i.h>
00041 
00042 #ifdef TLS
00043 __thread mtm_tx_t* _mtm_thread_tx;
00044 #else /* ! TLS */
00045 pthread_key_t _mtm_thread_tx;
00046 #endif /* ! TLS */
00047 
00048 volatile mtm_word_t locks[LOCK_ARRAY_SIZE];
00049 
00050 #ifdef CLOCK_IN_CACHE_LINE
00051 /* At least twice a cache line (512 bytes to be on the safe side) */
00052 volatile mtm_word_t gclock[1024 / sizeof(mtm_word_t)];
00053 #else /* ! CLOCK_IN_CACHE_LINE */
00054 volatile mtm_word_t gclock;
00055 #endif /* ! CLOCK_IN_CACHE_LINE */
00056 
00057 
00058 int vr_threshold;
00059 int cm_threshold;
00060 
00061 mtm_rwlock_t mtm_serial_lock;

Generated on Sat Apr 23 11:43:36 2011 for Mnemosyne by  doxygen 1.4.7