*** empty log message ***

svn path=/trunk/boinc/; revision=8155
This commit is contained in:
David Anderson 2005-09-23 20:59:39 +00:00
parent 1e581bcc24
commit f2d9aa4b8f
11 changed files with 57 additions and 83 deletions

View File

@ -56,7 +56,6 @@ using namespace std;
#ifdef __cplusplus
extern "C" {
#endif
//extern int boinc_shutdown_graphics();
#ifdef __cplusplus
}
#endif
@ -84,6 +83,7 @@ extern "C" {
// Unless otherwise noted, "CPU time" refers to the sum over all episodes
// (not counting the part after the last checkpoint in an episode).
void (*stop_graphics_thread_ptr)() = 0;
static APP_INIT_DATA aid;
static FILE_LOCK file_lock;
APP_CLIENT_SHM* app_client_shm = 0;
@ -376,13 +376,14 @@ int boinc_finish(int status) {
// unlock the lockfile and call the appropriate exit function
// This is called from the worker thread or the timer thread.
//
void boinc_exit(int status) {
#ifdef BOINC_APP_GRAPHICS
// Shutdown graphics if it is running
// Shutdown graphics thread if it is running
//
//boinc_shutdown_graphics();
#endif
if (stop_graphics_thread_ptr) {
(*stop_graphics_thread_ptr)();
}
// Unlock the lock file
//

View File

@ -131,6 +131,7 @@ extern void block_sigalrm();
#endif
extern int boinc_init_options_general(BOINC_OPTIONS& opt);
extern int set_worker_timer(void);
extern void (*stop_graphics_thread_ptr)();
inline void boinc_options_defaults(BOINC_OPTIONS& b) {
b.main_program = true;

View File

@ -39,10 +39,6 @@ int boinc_init_graphics(void (*worker)()) {
return boinc_init_graphics_impl(worker, &boinc_main_state);
}
int boinc_shutdown_graphics() {
return boinc_shutdown_graphics_impl(&boinc_main_state);
}
int boinc_init_options_graphics(BOINC_OPTIONS& opt, void (*worker)()) {
init_main_state();
return boinc_init_options_graphics_impl(opt, worker, &boinc_main_state);

View File

@ -37,7 +37,6 @@ extern "C" {
typedef void (*WORKER_FUNC_PTR)();
extern int boinc_init_graphics(WORKER_FUNC_PTR);
extern int boinc_shutdown_graphics();
// Functions that must be supplied by the app
//

View File

@ -31,7 +31,6 @@
#ifdef _WIN32
extern void win_graphics_event_loop();
extern void win_graphics_shutdown_event_loop();
#else
#include <cstring>
#include <cstdarg>
@ -84,11 +83,6 @@ int boinc_init_graphics_impl(WORKER_FUNC_PTR worker, BOINC_MAIN_STATE* bmsp) {
return boinc_init_options_graphics_impl(opt, worker, bmsp);
}
// the following function can be in a shared library,
int boinc_shutdown_graphics_impl(BOINC_MAIN_STATE* bmsp) {
return boinc_shutdown_options_graphics_impl(bmsp);
}
int start_worker_thread(WORKER_FUNC_PTR _worker_main) {
worker_main = _worker_main;
#ifdef _WIN32
@ -179,15 +173,6 @@ int boinc_init_options_graphics_impl(
return 0;
}
int boinc_shutdown_options_graphics_impl(
BOINC_MAIN_STATE* bmsp
) {
#ifdef _WIN32
win_graphics_shutdown_event_loop();
#endif
return 0;
}
#ifndef _WIN32
extern "C" {
void glut_quit() {

View File

@ -40,10 +40,6 @@ extern int boinc_init_graphics_impl(
WORKER_FUNC_PTR worker, BOINC_MAIN_STATE*
);
extern int boinc_shutdown_graphics_impl(
BOINC_MAIN_STATE*
);
// This extern C is needed to make this code work correctly,
// even in a 100% C++ context.
// This is because we need to dlsym() resolve this function.
@ -57,9 +53,6 @@ extern "C" {
WORKER_FUNC_PTR _worker_main,
BOINC_MAIN_STATE*
);
extern int boinc_shutdown_options_graphics_impl(
BOINC_MAIN_STATE*
);
}
extern BOINC_MAIN_STATE* g_bmsp;

View File

@ -488,9 +488,34 @@ static VOID CALLBACK timer_handler(HWND, UINT, UINT, DWORD) {
}
}
// This is called from the worker or multimedia timer thread,
// when it's preparing to exit.
// Shut down the graphics thread to avoid crash on exit.
//
static void stop_graphics_thread() {
// Shutdown the timer and stop processing messages
//
if (gfx_timer_id) {
KillTimer(NULL, gfx_timer_id);
gfx_timer_id = NULL;
}
// Process any outstanding messages
//
Sleep(0);
// Close down any open window and clean up
//
if (!boinc_is_standalone()) {
set_mode(MODE_HIDE_GRAPHICS);
}
}
void win_graphics_event_loop() {
MSG msg; // Windows Message Structure
stop_graphics_thread_ptr = stop_graphics_thread;
// Detect platform information
OSVERSIONINFO osvi;
osvi.dwOSVersionInfoSize = sizeof(osvi);
@ -522,24 +547,4 @@ void win_graphics_event_loop() {
SetEvent(hQuitEvent); // Signal the worker thread that we're quitting
}
void win_graphics_shutdown_event_loop() {
// Shutdown the timer and stop processing messages
//
if (gfx_timer_id) {
KillTimer(NULL, gfx_timer_id);
gfx_timer_id = NULL;
}
// Process any outstanding messages and stuff before moving
// on.
//
Sleep(0);
// Close down any open window and cleanup
//
if (!boinc_is_standalone()) {
set_mode(MODE_HIDE_GRAPHICS);
}
}
const char *BOINC_RCSID_462f482d81 = "$Id$";

View File

@ -12048,3 +12048,22 @@ David 22 Sept 2005
user/
edit_passwd_action.php
login_action.php
David 23 Sept 2005
- Redo the "clean up graphics thread before exit" logic.
boinc_api.C now has a function pointer that gets set
(in the Windows graphics case) to point to a cleanup function.
This gets called in boinc_exit().
Got rid of boinc_shutdown_graphics_impl(),
boinc_shutdown_options_graphics_impl(), boinc_shutdown_graphics().
Let's try to keep it simple.
TODO: it's not clear to me that the graphics cleanup function
will actually work. Rom's going to redo it.
api/
boinc_api.C,h
graphics_api.C,h
graphics_impl.C,h
windows_opengl.C

View File

@ -2,6 +2,10 @@
$project_news = array(
array("September 23, 2005",
"<a href=server_perf.pdf>High-Performance Task Distribution for Volunteer Computing</a>, a paper about BOINC server performance,
will appear in the e-Science 2005 conference in December."
),
array("September 6, 2005",
"<a href=http://www.theinstitute.ieee.org/portal/site/tionline/menuitem.130a3558587d56e8fb2275875bac26c8/index.jsp?&pName=institute_level1_article&TheCat=2201&article=tionline/legacy/inst2005/sep05/9w.fgravity.xml&>Searching for Gravity @ Home</a>, an article about Einstein@home and BOINC,
appears in the September 2005 issue of IEEE's <i>The Institute</i>."

View File

@ -98,7 +98,8 @@ resources
<li> <a href=contact.php>Personnel and contact info</a>
<li> BOINC <a href=email_lists.php>email lists</a>
<li> BOINC <a href=dev/>message boards</a>
<li> An <a href=intro.php>overview of BOINC</a>, and links to papers
<li> An <a href=intro.php>overview of BOINC</a>
<li> <a href=papers.php>Papers about BOINC</a>
<li> How to get involved in
<ul>
<li> <a href=boinc_dev.php>Software development and testing</a>

View File

@ -5,36 +5,6 @@ echo"
<p>
BOINC is a software platform for distributed computing
using volunteered computer resources.
<p>
<h2>Papers related to BOINC</h2>
<p>
<a href=boinc2.pdf>Public Computing: Reconnecting People to Science<a>
<br>David P. Anderson.
<br>Conference on Shared Knowledge and the Web,
<br>Residencia de Estudiantes, Madrid, Spain, Nov. 17-19 2003.
<p>
A paper about BOINC's goals.
Also available in
<a href=madrid.html>HTML</a> |
<a href=http://boinc.de/madrid_de.htm>HTML/German</a> |
<a href=http://www.seti.nl/content.php?c=boinc_berkeley_madrid>HTML/Dutch</a>
<p>
<a href=grid_paper_04.pdf>BOINC: A System for Public-Resource Computing and Storage</a>
<br>David P. Anderson.
<br>5th IEEE/ACM International Workshop on Grid Computing,
<br>November 8, 2004, Pittsburgh, USA.
<p>
A more technical paper.
<p>
Developing Distributed Computing Solutions Combining Grid Computing and
Public Computing.
M.Sc. Thesis by Jakob Gregor Pedersen & Christian Ulrik Søttrup.
http://www.fatbat.dk/thesis/
<h2>Features of BOINC</h2>
<p>
The BOINC's features fall into several areas:
<h3>Resource sharing among independent projects</h3>