Re: [Cppcms-users] Reload views from .so
Brought to you by:
artyom-beilis
From: Artyom B. <art...@ya...> - 2011-11-29 20:54:36
|
Hello, Two points: 1. If auto_reload is true the views would be automatically reloaded if the shared object had changed. So anything you need to do is to replace a shared object with a new one. This method is thread safe but has some performance penalty (it requires checking file timestamp each time the template is rendered) 2. You can manually load and unload shared object upon signal you get but this may be not thread safe so you need to make sure nothing happens. Such that if some thread renders HTML and you unload shared object bad things can happen. See: http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_config#views.auto_reload Does this fits you needs? Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.sf.net/ CppDB - C++ SQL Connectivity: http://cppcms.sf.net/sql/cppdb/ ----- Original Message ----- > From: Marcel Hellwig <ke...@co...> > To: cpp...@li... > Cc: > Sent: Tuesday, November 29, 2011 10:23 PM > Subject: [Cppcms-users] Reload views from .so > > Hi guys, > > i really love this framework and although I'm still learning CPP it's > great. The performance is... awesome! :) Big contrast to PHP or Tomcat. > So my question. I'd like to run the server and from time to time I'd > like to change the pages, but without resetting the server, so I thought > I'm putting some signal handler, which will reload all the views when > they get a SIGUSR1. I looked into the source and found, that you will > check in "views_pool.cpp:331" if the config auto_reload flag is true. > So > I thought it would be awesome, if you could outsource the thing where > you reload the files into a method you can call from the outside if you > want to. (wow, 4 times you in one sentence) > What is your opinion. Worth a try? > > > ------------------------------------------------------------------------------ > All the data continuously generated in your IT infrastructure > contains a definitive record of customers, application performance, > security threats, fraudulent activity, and more. Splunk takes this > data and makes sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-novd2d > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |