| 1 | = CPU scheduling in Version 4+ = |
| 2 | |
| 3 | == Time-slicing == |
| 4 | |
| 5 | Starting with version 4.00, the BOINC core client does '''time-slicing'''. This means that the core client may switch back and forth between results of different projects. This is done in a way that allocates CPU time according to the 'resource shares' you have assigned to each project. |
| 6 | |
| 7 | For example, suppose you participate in SETI@home with resource share 100 and Predictor@home with resource share 200. A single-processor machine might be scheduled as follows: |
| 8 | |
| 9 | {{{ |
| 10 | 1:00 - 2:00: SETI@home |
| 11 | 2:00 - 3:00: Predictor@home |
| 12 | 3:00 - 4:00: Predictor@home |
| 13 | 4:00 - 5:00: SETI@home |
| 14 | 5:00 - 6:00: Predictor@home |
| 15 | 6:00 - 7:00: Predictor@home |
| 16 | ... |
| 17 | }}} |
| 18 | |
| 19 | A two-processor machine might be scheduled as follows: |
| 20 | |
| 21 | {{{ |
| 22 | CPU 0 CPU 1 |
| 23 | 1:00 - 2:00: Predictor@home SETI@home |
| 24 | 2:00 - 3:00: Predictor@home SETI@home |
| 25 | 3:00 - 4:00: Predictor@home Predictor@home |
| 26 | 4:00 - 5:00: Predictor@home SETI@home |
| 27 | 5:00 - 6:00: Predictor@home SETI@home |
| 28 | 6:00 - 7:00: Predictor@home Predictor@home |
| 29 | }}} |
| 30 | |
| 31 | In every 3 hour period, your computer spends 4 hours on Predictor@home and 2 hours on SETI@home, which is the desired ratio. |
| 32 | |
| 33 | This feature is necessary to handle projects like [http://climateprediction.net/ Climateprediction.net], whose work units take a long time (1 or 2 months) to complete on a typical computer. Without time-slicing, your computer would have to finish an entire work unit before it could start working on a different project. |
| 34 | |
| 35 | == Preemption == |
| 36 | |
| 37 | When BOINC switches from one application to another, the first application is said to be '''preempted'''. BOINC can do preemption in two different ways; you can select this as part of your [GlobalPrefs General Preferences]. |
| 38 | |
| 39 | * '''Don't leave the suspended applications in memory''' (default). Applications are preempted by killing them; they are later restarted, and resume from their last checkpoint. This saves virtual memory (swap space) but can waste CPU time, especially if applications checkpoint infrequently. |
| 40 | * '''Leave suspended applications in memory'''. Applications are preempted by suspending them; they remain in virtual memory while preempted (they don't necessarily occupy physical memory). |