Re: [GnomeMeeting-devel-list] GnomeMeeting on 2.6



On Sat, 2004-01-31 at 16:00, Damien Sandras wrote:
> Hi all,
> 
> I can confirm it fixes the problem for me too!
> 
> Nice job!
> 
> I think Craig can commit the fix. Thanks very much!
> 

Hi,

I think we can scrap the last patch as it screws up gnomemeeting on
2.4.x.

I nailed it down to the following patch against 20040131-CVS pwlib
version which works for me on 2.4.23 and 2.6.1.

I don't know why the ifdef Linux sched_yield was there in the first
place.

I'm very interested in other people's experiences with this patch.
Somebody still running 2.2 or 2.0 ?



			Christian  

BTW nanosleep is a big difference between 2.4 and 2.6 because 2.6 is
running with HZ=1000 while 2.4 is HZ=100.

--- pwlib-cvs-20040131.CVS/src/ptlib/unix/tlibthrd.cxx-orig	2004-02-01 01:00:32.000000000 +0100
+++ pwlib-cvs-20040131.CVS/src/ptlib/unix/tlibthrd.cxx	2004-02-01 01:01:08.000000000 +0100
@@ -1053,25 +1053,21 @@
     pthread_testcancel();
 #endif
 
     lastTime = PTime();
   } while (lastTime < targetTime);
 }
 #endif
 
 void PThread::Yield()
 {
-  //sched_yield();
-  // re-add this if 2.4 becomes unusable..
-  // The following patch is improving 2.6 performance and it hopefully doesn't screw 2.4 ;)
-  struct timespec timer = { 0, 1 };
-  nanosleep (&timer, NULL);
+  sched_yield();
 }
 
 
 PThread * PThread::Current()
 {
   PProcess & process = PProcess::Current();
   process.threadMutex.Wait();
   PThread * thread = process.activeThreads.GetAt((unsigned)pthread_self());
   process.threadMutex.Signal();
   return thread;
@@ -1627,23 +1623,20 @@
   if (lockCount > 0) {
     lockCount--;
     return;
   }
 
   // otherwise mark mutex as available
   ownerThreadId = (pthread_t)-1;
 #endif
 
   PAssertPTHREAD(pthread_mutex_unlock, (&mutex));
-#ifdef P_LINUX
-  PThread::Yield();
-#endif
 }
 
 
 BOOL PMutex::WillBlock() const
 {
 #ifndef P_HAS_RECURSIVE_MUTEX
   pthread_t currentThreadId = pthread_self();
   if (currentThreadId == ownerThreadId)
     return FALSE;
 #endif



-- 
Christian Meder, email: chris onestepahead de
 
What's the railroad to me ?
I never go to see
Where it ends.
It fills a few hollows,
And makes banks for the swallows, 
It sets the sand a-blowing,
And the blackberries a-growing.
                      (Henry David Thoreau)
 







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]