Hi -

I noticed that there is a new FAQ entry which describes STM as a "bad 
thing".   Since synchronized methods in servlets have been (in the past)
declared as also a no-no, I would like to know what the current 
suggested design for building servlets which have high availability
and reasonable (but sub-optimal) scalability, given the constraint that
the servlet resource is serial in nature. 

For the sake of example, suppose that I have a sequence generator
which only responds to socket queries on a well known port.  Suppose 
that I am then hit with 20 concurrent requests for a new sequence 
number.  All servlets will attempt to use the port simultaneously, 
but one will obviously fail.

Unless I use home-grown Mutex code (ie, Pier's) to serialize, what 
is the alternative to dealing with this synchronization problem?

I know, I know.  A serial resource ain't gonna scale anyway.
But there are many callers (esp autonomous clients) which are really
quite happy to wait and _absolutely hate_ to get HTTP 500s back.
They are more concerned with availability than scalability.

It would seem to me that the requests should somehow be queued. 
Mutexes can provide that queuing, but this could be made more scalable
if the mechanism was event driven (like a conditional).  Thoughts?

Apologies if I'm missing something basic here.  Feel free to blast me.

-- 
::: Greg Barish ([EMAIL PROTECTED]) :::::::::::::::::::::::::::::::::::::::


-- --------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
READ THE FAQ!!!!     <http://java.apache.org/faq/>
Archives and Other:  <http://java.apache.org/main/mail.html/>
Problems?:           [EMAIL PROTECTED]

Reply via email to