]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
merge revs
authorJulian Seward <jseward@acm.org>
Sun, 15 Sep 2002 11:50:37 +0000 (11:50 +0000)
committerJulian Seward <jseward@acm.org>
Sun, 15 Sep 2002 11:50:37 +0000 (11:50 +0000)
   vg_scheduler.c 1.79.4.29
   vg_libpthread. c1.90.4.11

Reduce polling delays in poll(), select(), pause() and in the scheduler
idle loop.  This reduces some strange non-CPU-bound delays under certain
circumstances.

git-svn-id: svn://svn.valgrind.org/valgrind/branches/VALGRIND_1_0_BRANCH@973

vg_libpthread.c
vg_scheduler.c

index 1d1ab05adcdff196197e47b5350847d413b74c39..5972dfa640c23d24a84cf7ca46bc7fb76ac20818 100644 (file)
@@ -1185,7 +1185,7 @@ int pause ( void )
       if (n_now != n_orig) break;
 
       nanosleep_interval.tv_sec  = 0;
-      nanosleep_interval.tv_nsec = 52 * 1000 * 1000; /* 52 milliseconds */
+      nanosleep_interval.tv_nsec = 12 * 1000 * 1000; /* 12 milliseconds */
       /* It's critical here that valgrind's nanosleep implementation
          is nonblocking. */
       (void)my_do_syscall2(__NR_nanosleep, 
@@ -1977,7 +1977,7 @@ int do_syscall_select( int n,
    Basic idea is: modify the timeout parameter to select so that it
    returns immediately.  Poll like this until select returns non-zero,
    indicating something interesting happened, or until our time is up.
-   Space out the polls with nanosleeps of say 20 milliseconds, which
+   Space out the polls with nanosleeps of say 11 milliseconds, which
    is required to be nonblocking; this allows other threads to run.  
 
    Assumes:
@@ -2095,7 +2095,7 @@ int select ( int n,
       /* fprintf(stderr, "MY_SELECT: nanosleep\n"); */
       /* nanosleep and go round again */
       nanosleep_interval.tv_sec  = 0;
-      nanosleep_interval.tv_nsec = 50 * 1000 * 1000; /* 50 milliseconds */
+      nanosleep_interval.tv_nsec = 11 * 1000 * 1000; /* 11 milliseconds */
       /* It's critical here that valgrind's nanosleep implementation
          is nonblocking. */
       res = my_do_syscall2(__NR_nanosleep, 
@@ -2205,7 +2205,7 @@ int poll (struct pollfd *__fds, nfds_t __nfds, int __timeout)
       /* fprintf(stderr, "MY_POLL: nanosleep\n"); */
       /* nanosleep and go round again */
       nanosleep_interval.tv_sec  = 0;
-      nanosleep_interval.tv_nsec = 51 * 1000 * 1000; /* 51 milliseconds */
+      nanosleep_interval.tv_nsec = 13 * 1000 * 1000; /* 13 milliseconds */
       /* It's critical here that valgrind's nanosleep implementation
          is nonblocking. */
       (void)my_do_syscall2(__NR_nanosleep, 
index ebf3fff93034a6786896be108f6f7c746dab5596..658289de436f31059e329d36b12ad05260ec755b 100644 (file)
@@ -1129,7 +1129,7 @@ void nanosleep_for_a_while ( void )
    struct vki_timespec req;
    struct vki_timespec rem;
    req.tv_sec = 0;
-   req.tv_nsec = 20 * 1000 * 1000;
+   req.tv_nsec = 10 * 1000 * 1000;
    res = VG_(nanosleep)( &req, &rem );   
    vg_assert(res == 0 /* ok */ || res == 1 /* interrupted by signal */);
 }