2001-02-17 13:19:19 +01:00
|
|
|
/******************************************************
|
|
|
|
The interface to the operating system
|
|
|
|
process control primitives
|
|
|
|
|
|
|
|
(c) 1995 Innobase Oy
|
|
|
|
|
|
|
|
Created 9/30/1995 Heikki Tuuri
|
|
|
|
*******************************************************/
|
|
|
|
|
|
|
|
#ifndef os0proc_h
|
|
|
|
#define os0proc_h
|
|
|
|
|
|
|
|
#include "univ.i"
|
|
|
|
|
|
|
|
typedef void* os_process_t;
|
|
|
|
typedef unsigned long int os_process_id_t;
|
|
|
|
|
2003-01-06 21:07:25 +01:00
|
|
|
/* The cell type in os_awe_allocate_mem page info */
|
2003-01-30 17:52:45 +01:00
|
|
|
#if defined(__WIN2000__) && defined(ULONG_PTR)
|
2003-01-06 21:07:25 +01:00
|
|
|
typedef ULONG_PTR os_awe_t;
|
|
|
|
#else
|
|
|
|
typedef ulint os_awe_t;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Physical page size when Windows AWE is used. This is the normal
|
|
|
|
page size of an Intel x86 processor. We cannot use AWE with 2 MB or 4 MB
|
|
|
|
pages. */
|
|
|
|
#define OS_AWE_X86_PAGE_SIZE 4096
|
|
|
|
|
|
|
|
/********************************************************************
|
|
|
|
Windows AWE support. Tries to enable the "lock pages in memory" privilege for
|
|
|
|
the current process so that the current process can allocate memory-locked
|
|
|
|
virtual address space to act as the window where AWE maps physical memory. */
|
|
|
|
|
|
|
|
ibool
|
|
|
|
os_awe_enable_lock_pages_in_mem(void);
|
|
|
|
/*=================================*/
|
|
|
|
/* out: TRUE if success, FALSE if error;
|
|
|
|
prints error info to stderr if no success */
|
|
|
|
/********************************************************************
|
|
|
|
Allocates physical RAM memory up to 64 GB in an Intel 32-bit x86
|
|
|
|
processor. */
|
|
|
|
|
|
|
|
ibool
|
|
|
|
os_awe_allocate_physical_mem(
|
|
|
|
/*=========================*/
|
|
|
|
/* out: TRUE if success */
|
|
|
|
os_awe_t** page_info, /* out, own: array of opaque data containing
|
|
|
|
the info for allocated physical memory pages;
|
|
|
|
each allocated 4 kB physical memory page has
|
|
|
|
one slot of type os_awe_t in the array */
|
|
|
|
ulint n_megabytes); /* in: number of megabytes to allocate */
|
|
|
|
/********************************************************************
|
|
|
|
Allocates a window in the virtual address space where we can map then
|
|
|
|
pages of physical memory. */
|
|
|
|
|
|
|
|
byte*
|
|
|
|
os_awe_allocate_virtual_mem_window(
|
|
|
|
/*===============================*/
|
|
|
|
/* out, own: allocated memory, or NULL if did not
|
|
|
|
succeed */
|
|
|
|
ulint size); /* in: virtual memory allocation size in bytes, must
|
|
|
|
be < 2 GB */
|
|
|
|
/********************************************************************
|
|
|
|
With this function you can map parts of physical memory allocated with
|
|
|
|
the ..._allocate_physical_mem to the virtual address space allocated with
|
|
|
|
the previous function. Intel implements this so that the process page
|
|
|
|
tables are updated accordingly. A test on a 1.5 GHz AMD processor and XP
|
|
|
|
showed that this takes < 1 microsecond, much better than the estimated 80 us
|
|
|
|
for copying a 16 kB page memory to memory. But, the operation will at least
|
|
|
|
partially invalidate the translation lookaside buffer (TLB) of all
|
|
|
|
processors. Under a real-world load the performance hit may be bigger. */
|
|
|
|
|
|
|
|
ibool
|
|
|
|
os_awe_map_physical_mem_to_window(
|
|
|
|
/*==============================*/
|
|
|
|
/* out: TRUE if success; the function
|
|
|
|
calls exit(1) in case of an error */
|
|
|
|
byte* ptr, /* in: a page-aligned pointer to
|
|
|
|
somewhere in the virtual address
|
|
|
|
space window; we map the physical mem
|
|
|
|
pages here */
|
|
|
|
ulint n_mem_pages, /* in: number of 4 kB mem pages to
|
|
|
|
map */
|
|
|
|
os_awe_t* page_info); /* in: array of page infos for those
|
|
|
|
pages; each page has one slot in the
|
|
|
|
array */
|
Many files:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
mysqld.cc:
Change MySQL default isolation level to REPEATABLE READ; note that InnoDB has always had that default, and BDB and MyISAM always run at SERIALIZABLE level anyway
sql/mysqld.cc:
Change MySQL default isolation level to REPEATABLE READ; note that InnoDB has always had that default, and BDB and MyISAM always run at SERIALIZABLE level anyway
sql/ha_innodb.cc:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
sql/ha_innodb.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/buf0buf.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/dict0dict.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/fil0fil.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/lock0lock.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/os0file.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/os0proc.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/os0thread.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/page0cur.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/page0page.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/read0read.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/rem0rec.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/srv0srv.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/sync0rw.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/sync0sync.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/trx0purge.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/trx0trx.h:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/include/rem0rec.ic:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/btr/btr0btr.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/btr/btr0cur.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/btr/btr0pcur.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/buf/buf0buf.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/buf/buf0flu.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/dict/dict0dict.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/fil/fil0fil.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/fsp/fsp0fsp.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/ibuf/ibuf0ibuf.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/lock/lock0lock.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/mem/mem0dbg.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/os/os0file.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/os/os0proc.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/page/page0cur.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/page/page0page.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/pars/lexyy.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/pars/pars0grm.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/read/read0read.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/row/row0ins.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/row/row0mysql.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/row/row0purge.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/row/row0sel.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/row/row0uins.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/row/row0undo.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/row/row0upd.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/srv/srv0srv.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/srv/srv0start.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/sync/sync0rw.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/sync/sync0sync.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/trx/trx0purge.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
innobase/trx/trx0trx.c:
Merge InnoDB-4.0.5: new isolation levels READ COMMITTED and READ UNCOMMITTED now supported, selective deadlock resolution
2002-10-29 22:16:46 +01:00
|
|
|
/********************************************************************
|
|
|
|
Converts the current process id to a number. It is not guaranteed that the
|
|
|
|
number is unique. In Linux returns the 'process number' of the current
|
|
|
|
thread. That number is the same as one sees in 'top', for example. In Linux
|
|
|
|
the thread id is not the same as one sees in 'top'. */
|
|
|
|
|
|
|
|
ulint
|
|
|
|
os_proc_get_number(void);
|
|
|
|
/*====================*/
|
2001-02-17 13:19:19 +01:00
|
|
|
/********************************************************************
|
|
|
|
Allocates non-cacheable memory. */
|
|
|
|
|
|
|
|
void*
|
|
|
|
os_mem_alloc_nocache(
|
|
|
|
/*=================*/
|
|
|
|
/* out: allocated memory */
|
|
|
|
ulint n); /* in: number of bytes */
|
|
|
|
/********************************************************************
|
|
|
|
Sets the priority boost for threads released from waiting within the current
|
|
|
|
process. */
|
|
|
|
|
|
|
|
void
|
|
|
|
os_process_set_priority_boost(
|
|
|
|
/*==========================*/
|
|
|
|
ibool do_boost); /* in: TRUE if priority boost should be done,
|
|
|
|
FALSE if not */
|
|
|
|
|
|
|
|
#ifndef UNIV_NONINL
|
|
|
|
#include "os0proc.ic"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|