Don't take threads with other priorities into account as changing the
authorSebastian Wilhelmi <wilhelmi@ira.uka.de>
Thu, 9 Nov 2000 12:28:12 +0000 (12:28 +0000)
committerSebastian Wilhelmi <wilhelmi@src.gnome.org>
Thu, 9 Nov 2000 12:28:12 +0000 (12:28 +0000)
2000-11-09  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

* gthreadpool.c: Don't take threads with other priorities into
account as changing the priority is highly unportable. (Actually
using it at all already is unportable, but even sometimes where
that works, changing priority is not possible).

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
glib/gthreadpool.c
gthreadpool.c

index dec95dba07315bfa9782b776478c02d0c79b34b1..57964146d58a9956a3d19cb62e1f6d2870d73eac 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2000-11-09  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * gthreadpool.c: Don't take other threads with other priorities
+       into account as changing the priority is highly
+       unportable. (Actually using it at all already is unportable, but
+       even sometimes where that works, changing priority is not
+       possible).
+
 2000-11-05  Havoc Pennington  <hp@pobox.com>
 
        * gmarkup.h: rename G_MARKUP_FOO to
index dec95dba07315bfa9782b776478c02d0c79b34b1..57964146d58a9956a3d19cb62e1f6d2870d73eac 100644 (file)
@@ -1,3 +1,11 @@
+2000-11-09  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * gthreadpool.c: Don't take other threads with other priorities
+       into account as changing the priority is highly
+       unportable. (Actually using it at all already is unportable, but
+       even sometimes where that works, changing priority is not
+       possible).
+
 2000-11-05  Havoc Pennington  <hp@pobox.com>
 
        * gmarkup.h: rename G_MARKUP_FOO to
index dec95dba07315bfa9782b776478c02d0c79b34b1..57964146d58a9956a3d19cb62e1f6d2870d73eac 100644 (file)
@@ -1,3 +1,11 @@
+2000-11-09  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * gthreadpool.c: Don't take other threads with other priorities
+       into account as changing the priority is highly
+       unportable. (Actually using it at all already is unportable, but
+       even sometimes where that works, changing priority is not
+       possible).
+
 2000-11-05  Havoc Pennington  <hp@pobox.com>
 
        * gmarkup.h: rename G_MARKUP_FOO to
index dec95dba07315bfa9782b776478c02d0c79b34b1..57964146d58a9956a3d19cb62e1f6d2870d73eac 100644 (file)
@@ -1,3 +1,11 @@
+2000-11-09  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * gthreadpool.c: Don't take other threads with other priorities
+       into account as changing the priority is highly
+       unportable. (Actually using it at all already is unportable, but
+       even sometimes where that works, changing priority is not
+       possible).
+
 2000-11-05  Havoc Pennington  <hp@pobox.com>
 
        * gmarkup.h: rename G_MARKUP_FOO to
index dec95dba07315bfa9782b776478c02d0c79b34b1..57964146d58a9956a3d19cb62e1f6d2870d73eac 100644 (file)
@@ -1,3 +1,11 @@
+2000-11-09  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * gthreadpool.c: Don't take other threads with other priorities
+       into account as changing the priority is highly
+       unportable. (Actually using it at all already is unportable, but
+       even sometimes where that works, changing priority is not
+       possible).
+
 2000-11-05  Havoc Pennington  <hp@pobox.com>
 
        * gmarkup.h: rename G_MARKUP_FOO to
index dec95dba07315bfa9782b776478c02d0c79b34b1..57964146d58a9956a3d19cb62e1f6d2870d73eac 100644 (file)
@@ -1,3 +1,11 @@
+2000-11-09  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * gthreadpool.c: Don't take other threads with other priorities
+       into account as changing the priority is highly
+       unportable. (Actually using it at all already is unportable, but
+       even sometimes where that works, changing priority is not
+       possible).
+
 2000-11-05  Havoc Pennington  <hp@pobox.com>
 
        * gmarkup.h: rename G_MARKUP_FOO to
index dec95dba07315bfa9782b776478c02d0c79b34b1..57964146d58a9956a3d19cb62e1f6d2870d73eac 100644 (file)
@@ -1,3 +1,11 @@
+2000-11-09  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * gthreadpool.c: Don't take other threads with other priorities
+       into account as changing the priority is highly
+       unportable. (Actually using it at all already is unportable, but
+       even sometimes where that works, changing priority is not
+       possible).
+
 2000-11-05  Havoc Pennington  <hp@pobox.com>
 
        * gmarkup.h: rename G_MARKUP_FOO to
index dec95dba07315bfa9782b776478c02d0c79b34b1..57964146d58a9956a3d19cb62e1f6d2870d73eac 100644 (file)
@@ -1,3 +1,11 @@
+2000-11-09  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * gthreadpool.c: Don't take other threads with other priorities
+       into account as changing the priority is highly
+       unportable. (Actually using it at all already is unportable, but
+       even sometimes where that works, changing priority is not
+       possible).
+
 2000-11-05  Havoc Pennington  <hp@pobox.com>
 
        * gmarkup.h: rename G_MARKUP_FOO to
index d1a4d2c2467d882484d4b72c2e0e1e1799b41c0d..1d84229493d31bc453eb0d6b85057b6a1fc2bd4b 100644 (file)
@@ -151,9 +151,6 @@ g_thread_pool_thread_proxy (gpointer data)
          
          g_async_queue_lock (pool->queue);
 
-         if (pool->pool.priority != self->priority)
-           g_thread_set_priority (self, pool->pool.priority);
-
          /* pool->num_threads++ is not done here, but in
            * g_thread_pool_start_thread to make the new started thread
            * known to the pool, before itself can do it. */
@@ -184,28 +181,9 @@ g_thread_pool_start_thread (GRealThreadPool  *pool,
 
   g_async_queue_unlock (queue);
 
-  if (!success)
-    {
-      /* Now we search for threads with other priorities too, but
-       * only, when there is more than one unused thread with that
-       * priority. */
-      GThreadPriority priority;
-      for (priority = G_THREAD_PRIORITY_LOW; 
-          priority < G_THREAD_PRIORITY_URGENT + 1; priority++)
-       {
-         queue = unused_thread_queue[priority];
-         g_async_queue_lock (queue);
-         
-         if (g_async_queue_length_unlocked (queue) < -1)
-           {
-             g_async_queue_push_unlocked (queue, pool);
-             success = TRUE;
-           }
-         
-         g_async_queue_unlock (queue);
-       }      
-    }
-
+  /* We will not search for threads with other priorities, because changing
+   * priority is quite unportable */
+  
   if (!success)
     {
       GError *local_error = NULL;
@@ -251,7 +229,6 @@ g_thread_pool_new (GFunc            thread_func,
   retval->pool.priority = priority;
   retval->pool.exclusive = exclusive;
   retval->pool.user_data = user_data;
-
   retval->queue = g_async_queue_new ();
   retval->max_threads = max_threads;
   retval->num_threads = 0;
index d1a4d2c2467d882484d4b72c2e0e1e1799b41c0d..1d84229493d31bc453eb0d6b85057b6a1fc2bd4b 100644 (file)
@@ -151,9 +151,6 @@ g_thread_pool_thread_proxy (gpointer data)
          
          g_async_queue_lock (pool->queue);
 
-         if (pool->pool.priority != self->priority)
-           g_thread_set_priority (self, pool->pool.priority);
-
          /* pool->num_threads++ is not done here, but in
            * g_thread_pool_start_thread to make the new started thread
            * known to the pool, before itself can do it. */
@@ -184,28 +181,9 @@ g_thread_pool_start_thread (GRealThreadPool  *pool,
 
   g_async_queue_unlock (queue);
 
-  if (!success)
-    {
-      /* Now we search for threads with other priorities too, but
-       * only, when there is more than one unused thread with that
-       * priority. */
-      GThreadPriority priority;
-      for (priority = G_THREAD_PRIORITY_LOW; 
-          priority < G_THREAD_PRIORITY_URGENT + 1; priority++)
-       {
-         queue = unused_thread_queue[priority];
-         g_async_queue_lock (queue);
-         
-         if (g_async_queue_length_unlocked (queue) < -1)
-           {
-             g_async_queue_push_unlocked (queue, pool);
-             success = TRUE;
-           }
-         
-         g_async_queue_unlock (queue);
-       }      
-    }
-
+  /* We will not search for threads with other priorities, because changing
+   * priority is quite unportable */
+  
   if (!success)
     {
       GError *local_error = NULL;
@@ -251,7 +229,6 @@ g_thread_pool_new (GFunc            thread_func,
   retval->pool.priority = priority;
   retval->pool.exclusive = exclusive;
   retval->pool.user_data = user_data;
-
   retval->queue = g_async_queue_new ();
   retval->max_threads = max_threads;
   retval->num_threads = 0;