> I just glanced at the ipod code and I didn't see a problem like that, > but I am curious - why in load_ipod_db_idle_cb do you write lock/write > unlock multiple times? Why not just grab the write lock at the > beginning of the loop, create the entry, set it up, and then write > unlock? Mainly to keep the write lock as little as possible, in that case I guess this probably hurts more than it helps to consistently reacquire the write lock. I'm attaching a trace I got during a deadlock if that is of any interest to you. I haven't looked at it at all yet. Christophe
Thread 6 (Thread 1134255024 (LWP 25859)):
#0 0x40c740e5 in pthread_cond_wait@@GLIBC_2.3.2 ()
from /lib/tls/libpthread.so.0
#1 0x40cef465 in g_static_rw_lock_writer_lock (lock=0x8209ae4)
at gthread.c:757
#2 0x08092d48 in rhythmdb_write_lock (db=0x8209ac8) at rhythmdb.c:581
#3 0x08099450 in rhythmdb_tree_parser_end_element (ctx=0x820a7e8,
name=0x822a734 "entry") at rhythmdb-tree.c:493
#4 0x40ba83b8 in xmlParseEndTag1 (ctxt=0x8221930, line=-4) at parser.c:6645
#5 0x40baadbf in xmlParseElement (ctxt=0x8221930) at parser.c:7945
#6 0x40baaa7f in xmlParseContent (ctxt=0x8221930) at parser.c:7759
#7 0x40baad09 in xmlParseElement (ctxt=0x8221930) at parser.c:7919
#8 0x40bac043 in xmlParseDocument (ctxt=0x8221930) at parser.c:8510
#9 0x0809988d in rhythmdb_tree_load (rdb=0xfffffffc, die=0xfffffffc)
at rhythmdb-tree.c:631
#10 0x0809424e in rhythmdb_load_thread_main (db=0x8209ac8) at rhythmdb.c:1148
#11 0x40cee76d in g_thread_create_proxy (data=0x8209960) at gthread.c:601
#12 0x40c71974 in start_thread () from /lib/tls/libpthread.so.0
Thread 5 (Thread 1125866416 (LWP 25858)):
#0 0x40c74290 in pthread_cond_timedwait@@GLIBC_2.3.2 ()
from /lib/tls/libpthread.so.0
#1 0x40b727ca in g_cond_timed_wait_posix_impl (cond=0x820a9e0,
entered_mutex=0x0, abs_time=0x9) at gthread-posix.c:229
#2 0x40cbf3e1 in g_async_queue_pop_intern_unlocked (queue=0x8209bf8, try=0,
end_time=0x431b5a50) at gasyncqueue.c:244
#3 0x40cbf86d in g_async_queue_timed_pop (queue=0x8209bf8,
end_time=0xfffffffc) at gasyncqueue.c:370
#4 0x08093b62 in read_queue (queue=0x8209bf8, cancel=0x8209b68)
at rhythmdb.c:954
#5 0x08093feb in action_thread_main (db=0x8209ac8) at rhythmdb.c:1074
#6 0x40cee76d in g_thread_create_proxy (data=0x820a618) at gthread.c:601
#7 0x40c71974 in start_thread () from /lib/tls/libpthread.so.0
Thread 4 (Thread 1117477808 (LWP 25857)):
#0 0x40c740e5 in pthread_cond_wait@@GLIBC_2.3.2 ()
from /lib/tls/libpthread.so.0
#1 0x40cef045 in g_static_rw_lock_reader_lock (lock=0x8209ae4)
at gthread.c:757
#2 0x08092ce5 in rhythmdb_read_lock (db=0xfffffffc) at rhythmdb.c:569
#3 0x08093d24 in update_song (db=0x8209ac8, entry=0x828acf0, error=0xfffffffc)
at rhythmdb.c:1003
#4 0x08093ef8 in update_thread_main (db=0x8209ac8) at rhythmdb.c:1053
#5 0x40cee76d in g_thread_create_proxy (data=0x820a5a8) at gthread.c:601
#6 0x40c71974 in start_thread () from /lib/tls/libpthread.so.0
Thread 3 (Thread 1109089200 (LWP 25856)):
#0 0x40c74290 in pthread_cond_timedwait@@GLIBC_2.3.2 ()
from /lib/tls/libpthread.so.0
#1 0x40b727ca in g_cond_timed_wait_posix_impl (cond=0x820a848,
entered_mutex=0x0, abs_time=0x9) at gthread-posix.c:229
#2 0x40cbf3e1 in g_async_queue_pop_intern_unlocked (queue=0x8209bc0, try=0,
end_time=0x421b5a60) at gasyncqueue.c:244
#3 0x40cbf86d in g_async_queue_timed_pop (queue=0x8209bc0,
end_time=0xfffffffc) at gasyncqueue.c:370
#4 0x08093b62 in read_queue (queue=0x8209bc0, cancel=0x8209b68)
at rhythmdb.c:954
#5 0x08093c12 in add_thread_main (db=0x8209ac8) at rhythmdb.c:970
#6 0x40cee76d in g_thread_create_proxy (data=0x820a538) at gthread.c:601
#7 0x40c71974 in start_thread () from /lib/tls/libpthread.so.0
Thread 2 (Thread 1100700592 (LWP 25855)):
#0 0x40c740e5 in pthread_cond_wait@@GLIBC_2.3.2 ()
from /lib/tls/libpthread.so.0
#1 0x40cbf49a in g_async_queue_pop_intern_unlocked (queue=0x8576070, try=0,
end_time=0x0) at gasyncqueue.c:237
#2 0x40cbf50c in g_async_queue_pop (queue=0x8576070) at gasyncqueue.c:277
#3 0x08097585 in rhythmdb_query_model_finish_complete (model=0xfffffffc)
at rhythmdb-query-model.c:566
#4 0x080959e7 in query_thread_main (data=0x855db50, db=0x8209ac8)
at rhythmdb.c:1795
#5 0x40cefcc9 in g_thread_pool_thread_proxy (data=0x820a418)
at gthreadpool.c:113
#6 0x40cee76d in g_thread_create_proxy (data=0x820a478) at gthread.c:601
#7 0x40c71974 in start_thread () from /lib/tls/libpthread.so.0
Thread 1 (Thread 1089741728 (LWP 25852)):
#0 0x40c740e5 in pthread_cond_wait@@GLIBC_2.3.2 ()
from /lib/tls/libpthread.so.0
#1 0x40cef045 in g_static_rw_lock_reader_lock (lock=0x8209ae4)
at gthread.c:757
#2 0x08092ce5 in rhythmdb_read_lock (db=0xfffffffc) at rhythmdb.c:569
#3 0x08097995 in rhythmdb_query_model_do_insert (model=0x8574928,
entry=0x822ab00) at rhythmdb-query-model.c:724
#4 0x08097f15 in rhythmdb_query_model_poll (model=0x8574928,
timeout=0xbffff530) at rhythmdb-query-model.c:848
#5 0x08097d11 in idle_poll_model (model=0x8574928)
at rhythmdb-query-model.c:808
#6 0x40cd7db3 in g_idle_dispatch (source=0x85760e0, callback=0x1,
user_data=0xfffffffc) at gmain.c:3538
#7 0x40cd4915 in g_main_dispatch (context=0x810a560) at gmain.c:1753
#8 0x40cd59c8 in g_main_context_dispatch (context=0x810a560) at gmain.c:2297
#9 0x40cd5d00 in g_main_context_iterate (context=0x810a560, block=1,
dispatch=1, self=0x80f6ea8) at gmain.c:2378
#10 0x40cd6461 in g_main_loop_run (loop=0x81c0580) at gmain.c:2598
#11 0x40925298 in bonobo_main () at bonobo-main.c:297
#12 0x0805f1f8 in main (argc=1, argv=0xbffff924) at main.c:177
Ceci est une partie de message=?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e=2E?=