here is the code a picked from application.py
may be it's a bug here, it is the return expression that stoped the clean
work!


    def _cleanup_threadlocal(self):
        return  <-------------------LOOKES LIKE A BUG
        #@@@
        # Since the CherryPy Webserver uses thread pool, the thread-local
state is never cleared.
        # This interferes with the other requests.
        # clearing the thread-local storage to avoid that.
        # see utils.ThreadedDict for details
        import threading
        t = threading.currentThread()
        if hasattr(t, '_d'):
            del t._d

2009/1/5 Alva Yi <[email protected]>

> Thanks for your reply. I just have read CherryPy Server's source code, and
> I even want to add a row to clear the dictionary after the request even it
> is not a good idea to hack it like this.
> And as you remained, how can I use session? bound it to web.ctx? I just
> didn't figure it out.
> It's seems that all the code examples of session usage have problem like I
> said, after a few requests, the threads become 'dirty'.
> can you give me another example? thank you.
>
> 2009/1/5 Aaron Swartz <[email protected]>
>
>
>> Yes, ThreadedDict doesn't clear its dictionaries when a request is
>> done, because it doesn't know anything about requests. web.ctx, on the
>> other hand, does get cleared at the end of requests.
>>
>> >>
>>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to