Changes between Version 54 and Version 55 of BasicApi
- Timestamp:
- Jan 26, 2015, 1:15:19 PM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
BasicApi
v54 v55 7 7 Unless otherwise specified, the functions return an integer error code; 8 8 zero indicates success. 9 To use the API include the re header.9 To use the API include the header file: 10 10 {{{ 11 11 #include "boinc_api.h" 12 #include "filesys.h"13 12 }}} 14 13 15 14 BOINC applications may have an associate graphics program, 16 15 which can act as a screensaver. 17 The API for these graphics apps is [GraphicsAp ihere].18 19 == Initialization and termination== #init16 The API for these graphics apps is [GraphicsApps here]. 17 18 == Initialization == #init 20 19 21 20 Initialization must be done before calling other BOINC functions. 22 21 For sequential (single-threaded) apps, call 23 22 {{{ 24 23 boinc_init(); 25 24 }}} 26 25 27 Multi-thread apps: do not create any threads or store the current PID 28 before calling '''boinc_init()'''. 29 26 === Parallel apps === 27 28 If your uses multiple threads or processes for parallelism, initialize using 29 {{{ 30 BOINC_OPTIONS options; 31 32 boinc_options_defaults(options); 33 options.multi_thread = true; // if your app's main process uses multiple threads 34 options.multi_process = true; // if your app uses multiple processes 35 36 boinc_init_options(&options); 37 }}} 38 Do this before creating any threads or processes, or storing the PID. 39 40 === GPU and coprocessor apps === 41 42 If your app uses GPUs or coprocessors, initialize using 43 {{{ 44 BOINC_OPTIONS options; 45 46 boinc_options_defaults(options); 47 options.normal_thread_priority = true; 48 boinc_init_options(&options); 49 }}} 50 On Windows, this causes the application to run at normal thread priority, 51 so that the GPU will run at full speed even if the CPUs are loaded. 52 == Termination == 30 53 When the application has completed it must call 31 54