Timothy Goddard
7/6/2006 9:50:00 PM
Session variable? I take it this is on Rails?
Your original thread is probably ending the request and saving the
session before the other one can finish. You have to make the original
thread wait for the other one to finish using Thread.join.
Threads are very easy to make mistakes with. If you find tracking down
the cause of bugs like this hard, I wouldn't suggest using threads at
all without some further reading.
Erich Lin wrote:
> Hi,
>
> I forked off a thread using Thread.new. That thread is supposed to
> change a session variable. When I check the session variable in the
> thread's function, it had
> changed inside the thread. However, this change does not persist after
>
> the thread is finished.
>
> Does anyone know why?
>
> thanks