artyom beilis explannation
TRANSCRIPT
-
7/23/2019 Artyom Beilis Explannation
1/2
>
> 1. Can cppcms run multiple threads asynchronously?
> I know it can handle asynchronous requests by event loop but can it be
run with
> thread pool and run several requests simultaneously? Or the thread pool
is only
> for synchronous jobs.>
>
I dont really understand your question.
CppC!" thread pool has multiple threads to e#ecute any kind of $jobs$. %ou
post
a job to the thread pool and it would be picked up by an available threador would be
queued for e#ecution.
>
>
>&. Can Cppdb handle asynchronous query?
>
> I mean that providin' callback at query e#ecution and be
> called later when query is finished. !aybe this must be
> handled with cppcms event loop.> Is there any e#ample usin' asynchronous
query or its not possible?
>
(o) Cpp*+ cant run asynchronous queries) because there almost no ",- /I
available
that allows to run stuff asynchronously. "qlite0) !y",- and O*+C do not
provide such
an option.
"o if you want to run some $blockin'$ stuff you can submit a job to a
thread pool and posta completion handler back to the event loop.
>
>0. hat is the difference between runnin' cppcms as multi process mode
beside
> runnin' only sin'le process mode?
>
> I found that on windows platform it cant be run as multi process mode.
> Im not 'oin' to run it on windows for production but is there any other
bi'
> difference I have to aware? "omethin' like local cache is shared between> threads but not shared between processes. Or some performance effect like
-
7/23/2019 Artyom Beilis Explannation
2/2
> runnin' 2 processes with sin'le thread mode) or runnin' 1 process with 2
> threads. Information about Internal structure about performance would be
helpful.>
>
3irst of all even if you run in prefork 4multi5process6 mode you still have
a thread pool
per process.
dditionally) each process has its own event loop. In multi5process mode
you have several 5 one per process.
In future version of CppC!" it is planned to run several event loops per
CppC!" process.
bout sharin'. CppC!" supports process shared cache) session and otherstuff. 7owever on
the application level you should be aware of it. %ou run multiple instances
of the
same process so you should be aware of it) for e#ample usin' some sort of
I/C or shared
resources.
8o be honest. I found prefork 4multi5process6 mode much less useful that I
thou'ht it
would be.
>>
>9. *ynamic loadin' .so files
>I saw that cppcms hi'hly recommend to use dynamic loadin'
> views but I also found that auto update 4checkin' .so
> files modification date and auto reloadin' views6
> function may affect bad performance. "o) dynamic loadin'
> views are only 'ood with test mode and static library
> loadin' is better for production service?
>
> Im only askin' at the aspect of performance. -oadin' all> .so files at startup looks much better for performance. Im
> about to load more than 1:: .so view files.
%ou have an ;option; to dynamically reload so if it chan'es in the run5
time.
It is useful for development 4so you dont have to restart application
for a small 78!- fi#6) not more than that.
7owever usin' shared objects 'ives more more fle#ibility. It does not
impose performancepenalties) unless you turn the $auto5reload$ option on e#plicitly.