From: Dvořáček Michal <[EMAIL PROTECTED]>
> Hi there,
>
> little problem. I have program (like phorums) and there is command
> mark all posts as readed. On one board is about 4000 posts, and if is
> new user and want mark all posts as readed - it's problem (big).
>
> All is written in ANSI C (using C API functions). And here is main
> problem: when i execute "marking" thread (most of mysql code run as
> separately threads) and someone wants list this board (list thread)
> nothing happens. After about 15 seconds program show results. And if
> you type show command for two times program crashed. I'm not using
> locking tables. And question: is possible that SELECT will wait on
> previously or currently running INSERT and how is it multithread
> programs, where some threads are using same table (to avoid error like
> Out of synchronization, Query cannot be executed now, ....)
>
> Thanx
Hi.
Yes, MySQL will wait for a large insert to finish before running a select.
At least that's my experience.
You can get around this by either :
a) Adding granularity into your insert thread. Only insert 10 at a time for
example.
b) Use a table type that has row or page level locking.
Personally I'd use the later, but if you cannot do so for any reason, you'll
have to do the former.
Russ.
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php