> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> In my web application, I have a thread running in the background that 
> sends emails to the user when some event occurs.
> However, yesterday it stopped sending emails.
[...]
> My question is: why did this happen, why was necessary to 
> restart tomcat to get things right?

Any of a myriad reasons, but my first guess (until shown otherwise)
would be your threading code.  Writing threaded code so that it handles
unusual conditions properly is *hard*.

For example, are you *absolutely* sure that your code has *no* race
conditions that would cause syncronisation between the email thread and
any worker threads to be lost?  Even if (say) two worker threads tried
to submit jobs to the email thread at the same time?  Did you take a
thread dump before you restarted Tomcat to analyse for possible
deadlocks?  Are you running on a multi-core or hyperthreaded processor,
where 'at the same time' takes on new meaning if you're used to a single
CPU?

                - Peter

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to