Changes between Version 54 and Version 55 of BasicApi


Ignore:
Timestamp:
01/26/15 13:15:19 (3 years ago)
Author:
davea
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BasicApi

    v54 v55  
    77Unless otherwise specified, the functions return an integer error code;
    88zero indicates success.
    9 To use the API include there header.
     9To use the API include the header file:
    1010{{{
    1111#include "boinc_api.h"
    12 #include "filesys.h"
    1312}}}
    1413
    1514BOINC applications may have an associate graphics program,
    1615which can act as a screensaver.
    17 The API for these graphics apps is [GraphicsApi here].
    18 
    19 == Initialization and termination == #init
     16The API for these graphics apps is [GraphicsApps here].
     17
     18== Initialization == #init
    2019
    2120Initialization must be done before calling other BOINC functions.
    22 
     21For sequential (single-threaded) apps, call
    2322{{{
    2423boinc_init();
    2524}}}
    2625
    27 Multi-thread apps: do not create any threads or store the current PID
    28 before calling '''boinc_init()'''.
    29 
     26=== Parallel apps ===
     27
     28If your uses multiple threads or processes for parallelism, initialize using
     29{{{
     30BOINC_OPTIONS options;
     31
     32boinc_options_defaults(options);
     33options.multi_thread = true;    // if your app's main process uses multiple threads
     34options.multi_process = true;   // if your app uses multiple processes
     35
     36boinc_init_options(&options);
     37}}}
     38Do this before creating any threads or processes, or storing the PID.
     39
     40=== GPU and coprocessor apps ===
     41
     42If your app uses GPUs or coprocessors, initialize using
     43{{{
     44BOINC_OPTIONS options;
     45
     46boinc_options_defaults(options);
     47options.normal_thread_priority = true;
     48boinc_init_options(&options);
     49}}}
     50On Windows, this causes the application to run at normal thread priority,
     51so that the GPU will run at full speed even if the CPUs are loaded.
     52== Termination ==
    3053When the application has completed it must call
    3154