Hi, Ron!
On Mar 11, Ron Hu wrote:
> Hi Sergei:
>
> I use mysql-5.1.31 and observe that a table handler is shared by two user
> threads. Here is my experiment:
...
> Note that same table handler (value 0x058c8410) is used by two different
> user threads.
But it's not shared between threads. Only your first threads is using it
exclusively. Then it releases it, and the handler object is migrated to
another thread. Then this other thread is using it exclusively. No two
threads can use a handler object at the same time, it wasn't designed
for that.
When ::external_lock was called the handler object is locked by a
thread, no other thread may access it until ::external_lock(F_UNLCK) is
called. After that an object may go to a free pool and be picked up by a
different thread.
Regards / Mit vielen Grüßen,
Sergei
--
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Sergei Golubchik <serg@stripped>
/ /|_/ / // /\ \/ /_/ / /__ Principal Software Engineer/Server Architect
/_/ /_/\_, /___/\___\_\___/ Sun Microsystems GmbH, HRB München 161028
<___/ Sonnenallee 1, 85551 Kirchheim-Heimstetten
Geschäftsführer: Thomas Schroeder, Wolfgang Engels, Dr. Roland Boemer
Vorsitzender des Aufsichtsrates: Martin Häring