BRL-CAD
parallel.h
Go to the documentation of this file.
1 /* P A R A L L E L . H
2  * BRL-CAD
3  *
4  * Copyright (c) 2013-2014 United States Government as represented by
5  * the U.S. Army Research Laboratory.
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public License
9  * version 2.1 as published by the Free Software Foundation.
10  *
11  * This library is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this file; see the file named COPYING for more
18  * information.
19  */
20 
21 #ifndef LIBBU_PARALLEL_H
22 #define LIBBU_PARALLEL_H
23 
24 /**
25  * Set affinity mask of current thread to the CPU set it is currently
26  * running on. If it is not running on any CPUs in the set, it is
27  * migrated to CPU 0 by default.
28  *
29  * Return:
30  * 0 on Suceess
31  * -1 on Failure
32  *
33  */
34 extern int parallel_set_affinity(int cpu);
35 
36 extern void thread_set_cpu(int cpu);
37 extern int thread_get_cpu(void);
38 
39 #endif /* LIBBU_PARALLEL_H */
40 
41 /*
42  * Local Variables:
43  * mode: C
44  * tab-width: 8
45  * indent-tabs-mode: t
46  * c-file-style: "stroustrup"
47  * End:
48  * ex: shiftwidth=4 tabstop=8
49  */
int thread_get_cpu(void)
Definition: thread.cpp:115
int parallel_set_affinity(int cpu)
Definition: affinity.c:56
void thread_set_cpu(int cpu)
Definition: thread.cpp:108