taskqueue.cpp revision 375
869N/A * Copyright 2001-2006 Sun Microsystems, Inc. All Rights Reserved. 869N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 869N/A * This code is free software; you can redistribute it and/or modify it 869N/A * under the terms of the GNU General Public License version 2 only, as 869N/A * published by the Free Software Foundation. 869N/A * This code is distributed in the hope that it will be useful, but WITHOUT 869N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 869N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 869N/A * version 2 for more details (a copy is included in the LICENSE file that 869N/A * accompanied this code). 869N/A * You should have received a copy of the GNU General Public License version 869N/A * 2 along with this work; if not, write to the Free Software Foundation, 869N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 869N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 869N/A * CA 95054 USA or visit www.sun.com if you need additional information or 869N/A#
include "incls/_precompiled.incl" 0N/A const int a =
16807;
0N/A const int m =
2147483647;
869N/A const int q =
127773;
/* m div a */ 0N/A const int r =
2836;
/* m mod a */ 869N/A assert(
sizeof(
int) ==
4,
"I think this relies on that");
2624N/A //inner_termination_loop(); 1503N/A "thread %d sleeps after %d yields",
2624N/A // A sleep will cause this processor to seek work on another processor's 0N/A // runqueue, if it has nothing else to run (as opposed to the yield 2270N/A // which may only move the thread to the end of the this processor's 2624N/A "Terminator may still be in use");
2266N/A// Note that using this method will retrieve all regions 2266N/A// that have been saved but that it will always check 2266N/A// the overflow stack. It may be more efficient to 2266N/A// check the stealable queue and the overflow stack