Browse Source

use sleep timed after sched_yield for spinning busy loop

pull/2041/head
Andrew 7 years ago
parent
commit
27d0379a97
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      common.h

+ 5
- 1
common.h View File

@@ -366,7 +366,11 @@ typedef int blasint;
*/

#ifndef YIELDING
#define YIELDING sched_yield()
#define YIELDING nanosleep((const struct timespec[]){{0,10000L}},NULL);
// Line above is equal to following, but compliant with much older POSIX spec
// #define YIELDING usleep(10);
// Linux 2.4 might gain from implied scheduler programming instead
// #define YIELDING sched_yield()
#endif

/***


Loading…
Cancel
Save