----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files.  Don't make us guess your problem!!!
----------------------------------------------------------------

--- Hasan Bramwell <[EMAIL PROTECTED]> wrote:
> 
> Dear Nick
> 
> Thanks for your enormously helpful post.  You
> clarify just about all of
> my doubts very succinctly.
> 
> A couple of minor points though ..
> 
> Nick Bauman wrote:
> > 
> > 
> > Secondly, even if you plan to use green threads in
> > production, use native threads in development
> anyway.
> > Green threads can sometimes hide thread-saftey
> issues
> > that becoming glaring when using native threads.
> 
> You seem to be suggesting green-threads are better
> for a production
> environment ... which contradicts my
> understanding..?

No, I'm not trying to suggest that. Green thread
_might_ disguise some thread saftey issues. Emphasis
on the word disguise. The reasons for this would take
to much space here.
 
> I'm using Blackdown JDK 2.0 pre-release 1.0 right
> now, on RedHat 5.2,
> which gives me native threads .  Would you still
> recommend IBM 1.1.8?

Blackdown's 2.0 prerelease, AFAIK, doesn not appear to
work with native threads (last I checked). My tests
show that it is up to 7-15 times slower than the IBM
JDK. I would _still_ recommend IBM's jdk 1.1.8. 
 
> 
> > Note that native threads will often appear slower
> than
> > green threads unless you are using a threadpool.
> 
> Do you roll-your-own threadpool or can you recommend
> one?

I have been using ObjectSpace Voyager's ThreadPool
class, however it would be fairly easy write your own.
(or find one on the net)
 
> 
> > Third, mySQL: I remember now mySQL doesn't support
> > transactions. I believe you still need to committ
> > after each transaction, but I would look it up or
> > defer to others that have used jdbc with things
> like
> > Oracle and mySQL both. I have experience with only
> > Oracle and Sybase, and these definitely will run
> out
> > of cursors if you don't commit your reads.
> 
> I'm using Marc Mnich's dbConnectionBroker and don't
> have problems of
> running out of connections, at least.  You are
> saying that it is the
> databases that run out of cursors, not JDBC, right? 
> If so then I
> probably don't need to worry.  If not then I'll
> definitely see if
> rigorously performing commits helps with this, so
> thanks VERY much for
> that tip.
> 
> Nevertheless, I do seem to have memory problems. 
> This "free" is taken
> after a week on-line, serving about 250 users per
> day.
> 
> ]free
> ]      total       used       free     shared   
> buffers     cached
> ]Mem:  256040     251408       4632      20508     
> 91820     127224
> ]-/+ buffers/cache:      32364     223676
> ]Swap:       128484          0     128484
> 
> After startup and serving the first user I have over
> 200Mb free.  After
> a week I have only 4Mb free!  I should confess I
> don't fully understand
> the "free" listing yet nor how much of the memory is
> really
> unavailable.  Know a good tutorial on that?

It could be just the Blackdown JDK that's causing the
problems. This is a guess. 
 
> 
> > Finally, I can't think of a reason why you should
> need
> > to synchronize any servlet unless you are
> accessing
> > resources that are inter-servlet accessable.
> 
> I was seeing one user's data appearing in another
> user's session!!! 
> Synchronizing EVERYTHING allowed us to get on with
> testing.

This is broken code: a bug.

> I've subsequently corrected a bunch of classes
> inadvertently declared as
> "static", but haven't yet had the time to go back in
> and clear up all
> the "synchronized" bits.  The critical issue right
> now is to get the
> thing through usability testing, (most of the users
> have never used a
> computer before, let alone interactively by
> Internet).  But I want to
> get rid of memory problems so I can sleep at night
> :^)
> 
> I can't tell you how much I appreciate your
> authoritative answers. 
> Thanks very much.
> 
> Hasan

You're welcome.


=====
# Nick Bauman
# Technical Programmer
# http://webhelp.com
# real people, real answers, real time
__________________________________________________
Do You Yahoo!?
Thousands of Stores.  Millions of Products.  All in one place.
Yahoo! Shopping: http://shopping.yahoo.com


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

Reply via email to