diff -u -p -u -r1.27 rb-util.c
--- lib/rb-util.c	16 May 2006 12:56:52 -0000	1.27
+++ lib/rb-util.c	7 Jun 2006 10:04:50 -0000
@@ -381,6 +381,12 @@ rb_is_main_thread (void)
 	}
 }
 
+static gboolean
+purge_useless_threads (gpointer data)
+{
+	g_thread_pool_stop_unused_threads ();
+	return TRUE;
+}
 
 void
 rb_threads_init (void)
@@ -392,6 +398,9 @@ rb_threads_init (void)
 	 * set up lock functions some day..
 	 */
 	gdk_threads_init ();
+
+	/* purge useless thread-pool threads occasionally */
+	g_timeout_add (30 * 1000, purge_useless_threads, NULL);
 }
 
 gchar **
diff -u -p -u -r1.11 rhythmdb-private.h
--- rhythmdb/rhythmdb-private.h	28 May 2006 22:44:52 -0000	1.11
+++ rhythmdb/rhythmdb-private.h	7 Jun 2006 10:04:50 -0000
@@ -125,6 +125,7 @@ struct RhythmDBPrivate
 	GAsyncQueue *action_queue;
 	GAsyncQueue *event_queue;
 	GAsyncQueue *restored_queue;
+	GThreadPool *query_thread_pool;
 
 	GList *stat_list;
 	GHashTable *stat_events;
diff -u -p -u -r1.226 rhythmdb.c
--- rhythmdb/rhythmdb.c	28 May 2006 22:44:52 -0000	1.226
+++ rhythmdb/rhythmdb.c	7 Jun 2006 10:04:52 -0000
@@ -347,6 +347,10 @@ rhythmdb_init (RhythmDB *db)
 	db->priv->event_queue = g_async_queue_new ();
 	db->priv->restored_queue = g_async_queue_new ();
 
+	db->priv->query_thread_pool = g_thread_pool_new ((GFunc)query_thread_main,
+							 NULL,
+							 -1, FALSE, NULL);
+
 	db->priv->metadata = rb_metadata_new ();
 	
 	prop_class = g_type_class_ref (RHYTHMDB_TYPE_PROP_TYPE);
@@ -582,6 +586,7 @@ rhythmdb_finalize (GObject *object)
 		g_source_remove (db->priv->save_timeout_id);
 	}
 
+	g_thread_pool_free (db->priv->query_thread_pool, FALSE, TRUE);
 	g_async_queue_unref (db->priv->action_queue);
 	g_async_queue_unref (db->priv->event_queue);
 	g_async_queue_unref (db->priv->restored_queue);
@@ -2976,7 +2981,11 @@ rhythmdb_do_full_query_async_parsed (Rhy
 	rhythmdb_query_results_set_query (results, query);
 
 	g_object_ref (G_OBJECT (results));
-	rhythmdb_thread_create (db, (GThreadFunc) query_thread_main, data);
+	g_object_ref (G_OBJECT (db));
+	g_atomic_int_inc (&db->priv->outstanding_threads);
+	g_async_queue_ref (db->priv->action_queue);
+	g_async_queue_ref (db->priv->event_queue);
+	g_thread_pool_push (db->priv->query_thread_pool, data, NULL);
 }
 
 void
