Hi,
Lorenzo Fiorini wrote:
I've successfully implemented MT in my httpserver and the results are great, but http apps are made to be ( almost ) stateless while desktop apps are full of vars that remember selections, global and user setting, preferences and so on. Following the CL5 guidelines I've heavily used module wide static vars and set/get functions to access them but in a MT statics are difficult to share so the idea is to use a "big" public hash as a "session holder" where every static become a key with a value and share it between threads. What do you think? Do you see other paths?
Unfortunately, HTTP is stateless and session key stored in cookie is the key to solve a problem (still not very comfortable...).
Here I see the main difference between web application and GUI remote application.
Pritpal Bedi wrote:
Static variable as declared as STATIC are shared among threads. Static variables declared as THREAD STATIC have thread wide scope.
Static thread variables helps only in case you bind a thread to a session. It also solves the problem of reopening aliases, etc. It was implemented in my uhttpd, but late I dropped such thread-session binding because of bad "thread reusage" and uncommon application architecture. It's very easy to make 1000 or much more open http sessions (imagine 20 minutes session timeout) and waste all system resources.
Regards, Mindaugas _______________________________________________ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour