Changes between Version 31 and Version 32 of BasicApi


Ignore:
Timestamp:
Apr 14, 2011, 5:26:28 PM (13 years ago)
Author:
davea
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BasicApi

    v31 v32  
    1111The API for these graphics apps is [GraphicsApi here].
    1212
    13 BOINC applications may consist of several programs that are executed in sequence;
    14 these are called compound applications.
    15 See the [CompoundApps compound application API].
    16 
    1713== Initialization and termination == #init
    1814
    1915Initialization must be done before calling other BOINC functions.
    2016
    21 To initialize a single-thread program, call
    22 {{{
    23 #!c++
    24 int boinc_init();
    25 }}}
    26 
    27 To initialize a multi-thread program, call
    28 {{{
    29 #!c++
    30 int boinc_init_parallel();
    31 }}}
    32 
    33 Note that `boinc_init_parallel` will `fork` on Unix systems,
    34 so you must not create any thread or try to store the current PID
    35 before calling this function.
    36 If this function succeeds,
    37 the parent (original) process will run an internal loop,
    38 and will not return;
    39 code following the `boinc_init_parallel` call will run in the child process.
     17{{{
     18BOINC_OPTIONS options;
     19
     20boinc_options_defaults(options);
     21options.multi_thread = true;    // include this if your app's main process uses multiple threads
     22options.multi_process = true;   // include this if your app uses multiple processes
     23
     24boinc_init_options(&options);
     25}}}
     26
     27Do not create any threads or store the current PID
     28before calling '''boinc_init_options()'''.
    4029
    4130When the application has completed it must call