Re: [Cppcms-users] Reload views from .so
Brought to you by:
artyom-beilis
From: Artyom B. <art...@ya...> - 2011-11-30 12:12:16
|
----- Original Message ----- > From: Marcel Hellwig <ke...@co...> > To: Artyom Beilis <art...@ya...>; cpp...@li... > Cc: > Sent: Wednesday, November 30, 2011 9:12 AM > Subject: Re: [Cppcms-users] Reload views from .so > > no :) > I mean, that you can manually say, reload now! and he reloads. Maybe it > would be good enough if I set the boolean to true and afterwards back to > false, but it would be a nice option to say, reload the next time the > librarys but do not check always, because, you said it, of performance. > Maybe something like this: > > render().reloadLibrary(); > > and then he will set a flag and reloads the librarys but only once. Get it? > Few points. 1. Providing thread safe reload library would have almost the same performance penalty. In order to make it thread safe you need to acquire Read Lock on some R/W mutex. Checking the time-stamp requires small resources as well. So I don't what is the difference it can make. 2. First check how auto_reload option affects the performance if significantly then it may make sense to do something about but if it does not... Don't bother use auto_reload, I don't think it would be that bad. So if you want to switch the library just execute "move" on the shared object replacing it with new one and CppCMS would reload it automatically. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.sf.net/ CppDB - C++ SQL Connectivity: http://cppcms.sf.net/sql/cppdb/ |