From: Giuseppe C. <co...@lu...> - 2001-10-10 13:23:56
|
Hi all I'm a newbie in xine development and absolutely ignorant in video stuff so I can give only general advices... 1) metronom_sync_loop (metronom.c) I suggest changing the sleep() call with nanosleep(). Reasons: POSIX (and UNIX 98) absolutely require that sleep() function as specified for the calling thread without any effect at all on other threads. However, on implementations that don't/can't claim full POSIX conformance, sleep() is one of the functions voted most likely to be broken because the traditional implementation relies on SIGALRM and won't work correctly with threads. When such implementations support nanosleep(), that's more likely to work correctly, though there are no guarantees. (Again, POSIX requires that BOTH work correctly, and once someone's broken one rule, it makes little sense to bet they've followed other related rules... at least, don't bet very much. (comp.programming.threads FAQ) sleep() may be implemented using SIGALRM; mixing calls to alarm() and sleep() is a bad idea. (Linux manual) Anyway, using signals and threads is not a simple matter. One of the better strategies I've seen is to spawn a thread which waits for all the interesting signals. For every one catched it posts a semaphore (sem_post is signal safe). Other threads should wait on the semaphores. But this is the theory, I don't know if applicable to xine. 2) is it possible to have a general description/diagram on how the various xine threads are spawned/synchronized? Thank you -- Giuseppe "Cowo" Corbelli ~\/~ My software: http://cowo.mascanc.net -<! $>cd /pub $>more beer !>- |