|
From: Matthew B. <ma...@by...> - 2002-07-05 11:38:55
|
Hello;
I've just noticed an undesirable interaction between multithreaded Ruby
applications and the MySQL C API (if not other DB APIs); my web spider
application was running along fine but suddenly after an unpredictable number
of minutes, hours etc. it would stop dead. I think the problem is that I use
a "lock tables" statement which, if used with Ruby threads, blocks the whole
Ruby process until the table is unlocked. Trouble is if the 'thread' holding
the lock is an internal Ruby thread in the same process it'll never get run
to unlock it :-/
Is there a general way around this problem with the mysql_ API? My
impression is no, since I can't find any way of telling mysql to use
non-blocking semantics through its C API. Anyhow even if we leave it like
this it's probably worth adding a note about this pitfall to the docs.
cheers,
--
Matthew Bloch Bytemark Computer Consulting
http://www.bytemark.co.uk/
tel. +44 (0) 8707 455026
|