mariadb/include/srv0que.h

69 lines
2.4 KiB
C
Raw Normal View History

/*****************************************************************************
Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.
This program 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.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place, Suite 330, Boston, MA 02111-1307 USA
*****************************************************************************/
/**************************************************//**
@file include/srv0que.h
2005-10-27 07:29:40 +00:00
Server query execution
Created 6/5/1996 Heikki Tuuri
*******************************************************/
#ifndef srv0que_h
#define srv0que_h
#include "univ.i"
#include "que0types.h"
/**********************************************************************//**
2005-10-27 07:29:40 +00:00
Checks if there is work to do in the server task queue. If there is, the
thread starts processing a task. Before leaving, it again checks the task
queue and picks a new task if any exists. This is called by a SRV_WORKER
thread. */
UNIV_INTERN
2005-10-27 07:29:40 +00:00
void
srv_que_task_queue_check(void);
/*==========================*/
/**********************************************************************//**
2005-10-27 07:29:40 +00:00
Performs round-robin on the server tasks. This is called by a SRV_WORKER
thread every second or so.
@return the new (may be == thr) query thread to run */
UNIV_INTERN
2005-10-27 07:29:40 +00:00
que_thr_t*
srv_que_round_robin(
/*================*/
que_thr_t* thr); /*!< in: query thread */
/**********************************************************************//**
2005-10-27 07:29:40 +00:00
Enqueues a task to server task queue and releases a worker thread, if
there exists one suspended. */
UNIV_INTERN
2005-10-27 07:29:40 +00:00
void
srv_que_task_enqueue(
/*=================*/
que_thr_t* thr); /*!< in: query thread */
/**********************************************************************//**
2005-10-27 07:29:40 +00:00
Enqueues a task to server task queue and releases a worker thread, if
there exists one suspended. */
UNIV_INTERN
2005-10-27 07:29:40 +00:00
void
srv_que_task_enqueue_low(
/*=====================*/
que_thr_t* thr); /*!< in: query thread */
2005-10-27 07:29:40 +00:00
#endif