The BOINC core/application interface, version 4.0
The dynamic part must support several functions:
This interface has several shortcomings:
Version 4 uses the following message channels:
|process_control_req (core->app)||<suspend/>, <resume/>, <quit/>|
|process_control_reply (app->core)||same as above|
|graphics_req (core->app)||<window/>, <fullscreen/>, <none/>|
|graphics_reply (app->core)||same as above|
|heartbeat (core->app)||<heartbeat/>, <ignore_heartbeat/>|
|status (app->core)||<fraction_done>, etc.|
boinc_init(int flags)This creates a 'manager thread'; the calling thread is the 'worker thread'. The 'flags' argument specifies which message streams will be handled by the manager thread. By default, it handles the following message streams:
|process_control_req||The manager thread suspends and resumes the worker thread. It uses a semaphore to avoid suspending or aborting the worker thread while it's checkpointing.|
|heartbeat||It does exit(ERR_NO_HEARTBEAT) if heartbeat is lost|
|status||It measures and reports worker thread CPU time|
boinc_init_graphics()is unchanged; it creates a 'graphics thread' that calls application-supplied functions to render graphics and handle input.
boinc_finish()is unchanged: it creates a 'finish file' and exits.
Version 4.0 leaves it up to the developer to decide which message channels are handled by which program. For example, suspend/resume messages might be handled by either the controller or the worker.
The following lower-level API functions are provided:
boinc_parse_app_init_data() boinc_attach_shmem() boinc_get_messageHere's an example in which the controller program handles graphics messages, and the work programs handle suspend/resume:
Controller program: boinc_parse_app_init_data() boinc_attach_shmem() while (1) boinc_write_app_init_data() spawn next worker program while (1) if worker has finished if successful break else exit if have graphics message start or kill graphics program boinc_parse_app_init_data() boinc_finish() Worker program: boinc_init() ... write 'phase done' file exit(0) // don't call boinc_finish()
Last modified 8:51 PM UTC, October 17 2012.
Copyright © 2017 University of California. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.