[AWS] Concurrency in AWS

Maciej Sobczak prog at msobczak.com
Wed Sep 5 17:28:54 CEST 2007


Hello,

I understand that AWS is a multitasking server that can handle many 
connections in paraller. This has some consequences in how the server 
interacts with the user-provided code via dispatchers, and this 
interaction is not very well documented.

Please let me know whether the following is precisely true:

1. There can be many concurrent (overlapping) invocations to Dispatch 
subprogram provided by the user.

2. Some of these concurrent invocations can actually affect the same 
physical Handler object in a given time.

3. Some of these concurrent invocations can affect separate (distinct) 
copies of the Handler object in a given time.

4. The user should never assume that his Handler object will be actually 
directly affected by any Dispatch invocation. Instead, the copy of the 
provided object can be used (that's why Handler provides refcounting 
functionality).

5. The user should not assume that his Handler object will persist for 
longer than a single invocation to Dispatch.


In addition:

Is it possible to keep some "task local state" that would be bound to 
the internal server task handling client connections?
The motivating example would be to create a pool of database 
connections. If the programmer decides to have the pool of database 
connections of the same size as Max_Connection parameter, then keeping 
the database connection object directly with the AWS task would nicely 
solve the problem of pool management.

Regards,

-- 
Maciej Sobczak : http://www.msobczak.com/
Programming    : http://www.msobczak.com/prog/


More information about the AWS mailing list