Re: [Cppcms-users] threading considerations when accessing session data from json-rpc
Brought to you by:
artyom-beilis
From: Artyom B. <art...@ya...> - 2012-02-29 10:43:52
|
----- Original Message ----- > From: Leon <le...@wl...> > > > Hi, > I am still not very clear about cppcms' threading model. Am I correct > that each json-rpc method will be run from a thread from the thread > pool? Do this mean that > each access to any session data should be protected by mutex? > > > Thanks! The session is accessed via cppcms::http::context and the context is request/response specific. So unless you access one context from two threads (which I don't see a reason to do) it is safe. The session storage thread safety is handled by CppCMS, depending in specific backend and transparent to you. Of course if you implement your own session storage you should deal with it on your own, but as I understand you don't. :-) Artyom Beilis ------------- Support CppCMS by donating money: https://sourceforge.net/donate/index.php?group_id=209965 |