Duke Martin wrote:
>
> Hello, can someone please help me?
>
> I am having a problem with my servlet that checks ... I think it has to do
> with the int nm. Maybe one user has set it to be equal to zero and at the
> same time another user is seeing this value of the variable and therefore
> not seeing the "You have new messages" notification.
>
This is a little borderline, but it comes up pretty frequently
with regard to servlets, so what the heck: If the variable "nm"
is truly non-static and local to the ReceiveMail() function, then each
thread calling into the function will get's it's very own independent
copy on the stack, so your problem is elsewhere, like in the code
that actually checks the mail.
If my saying "non-static" or "local" or "stack" confuses you at
all, then you really need to back off a step and get a good basic Java
book or walk through some of the tutorials on Sun's site. Doing
this will save you huge amounts of grief.
You might want to also check this (you should have already
checked it before you asked, but...)
<http://www.purpletech.com/servlet-faq/#thread-safe>
You might want to try putting in lots of debugging statements
tracking the value of nm. In each debugging statement make sure
you print out the thread name, so you can later track exactly
which thread thinks the value is what and when. Yes, I really
am suggesting that you may have to manually wade through huge
debugging outputs by hand.
Does anyone know of a good thread-debugging tutorial somplace?
Good luck.
-cks
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html