Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5669
Modified Files: Tag: devel_0_38 m_sched.c Log Message: tweaking sleepgrain
Index: m_sched.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/m_sched.c,v retrieving revision 1.5.4.20 retrieving revision 1.5.4.21 diff -C2 -d -r1.5.4.20 -r1.5.4.21 *** m_sched.c 6 Apr 2005 15:59:02 -0000 1.5.4.20 --- m_sched.c 7 Apr 2005 21:15:22 -0000 1.5.4.21 *************** *** 411,415 ****
sys_clearhist(); ! if (sys_sleepgrain < 1000) sys_sleepgrain = sys_schedadvance/4; if (sys_sleepgrain < 100) --- 411,417 ----
sys_clearhist(); ! ! /* tb: adapt sleepgrain with advance */ ! if (sys_schedadvance < 20000) sys_sleepgrain = sys_schedadvance/4; if (sys_sleepgrain < 100) *************** *** 504,508 **** #endif /* tb: call idle callbacks */ ! run_idle_callbacks(timeforward != SENDDACS_SLEPT?sys_sleepgrain*0.5:0);
#ifdef THREAD_LOCKING --- 506,510 ---- #endif /* tb: call idle callbacks */ ! run_idle_callbacks(timeforward != SENDDACS_SLEPT?sys_sleepgrain:0);
#ifdef THREAD_LOCKING *************** *** 672,676 **** sleep: /* sleep for the rest of the time */ ! if(remain > 100) sys_microsleep(remain); } else --- 674,679 ---- sleep: /* sleep for the rest of the time */ ! if(remain > 100) ! sys_microsleep(remain); } else *************** *** 685,688 **** --- 688,692 ---- { t_sched_callback * new_callback; + double stop = sys_getrealtime()*1.e6 + (double)microsec;
/* append idle callback to ringbuffer */ *************** *** 707,712 **** if (ringbuffer_head != NULL) { ! double remain; ! double stop = sys_getrealtime()*1.e6 + microsec; t_sched_callback * idle_callback = ringbuffer_head; t_sched_callback * last = NULL; --- 711,715 ---- if (ringbuffer_head != NULL) { ! double remain = stop - sys_getrealtime() * 1.e6; t_sched_callback * idle_callback = ringbuffer_head; t_sched_callback * last = NULL; *************** *** 751,755 **** } else ! sys_microsleep(microsec); } #endif --- 754,758 ---- } else ! sys_microsleep(microsec); } #endif