Brian Aker wrote:
Hi!

On Oct 12, 2008, at 3:01 PM, Roy Lyseng wrote:

Yes, but I guess there is usually a 1-1 connection between thread and session. Thus, most operations on the session can be done without synchronization. With more threads, this will change.


Nope, not in our world. There are many, and I mean many, groups who have 1K+ open sessions at a time.

You are misunderstanding me: What I mean is that when you have multiple threads running on behalf of a session, such as when you have multiple concurrent queries/statements running, then you need to synchronize more heavily on the session level.

Say that one of the statements forces a transaction abort, then all statements will need to abort. If one statement errs, then you may or may not (depending on the strategy you choose) force all other concurrent statements to roll back locally.

There are probably many such issues which need to be sorted out, and they probably need some sort of synchronization and state management on the session level.

I am not saying that decoupling Session and Thread is a bad thing, I am actually backing that decision. Having one or several threads executing on behalf of a session gives great opportunities for scaling, but as always there is no free lunch...

We actually decoupled sessions and threads in the HADB product. The reasoning behind that was that a thread might be assigned for the duration of a server roundtrip, and the thread could also carry some resources that were useful for the roundtrip duration, such as a temporary heap allocator (used e.g. for query preparation) and an execution machinery. Another reason was to accomodate parallel query processing, but that was never implemented.

There was also a Status object. which could be shared between session and thread in a 1-1 relationship, or there could be one Status object per thread and accumulation of statuses on the session level when all threads had completed their work.

Thanks,
Roy

_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help   : https://help.launchpad.net/ListHelp

Reply via email to