Re: [pylons-discuss] Store class at process start, and use it to initiate inside function?

2018-10-09 Thread Jonathan Vanasco
On Tuesday, October 9, 2018 at 12:08:35 PM UTC-4, Bert JW Regeer wrote: > > I would disagree, heavily. You want to create your globals once, then > fork. This way the memory used by said global can be shared between all of > the processes. +1 -- You received this message because you are

Re: [pylons-discuss] Store class at process start, and use it to initiate inside function?

2018-10-09 Thread Bert JW Regeer
I would disagree, heavily. You want to create your globals once, then fork. This way the memory used by said global can be shared between all of the processes. Instagram even added the ability to freeze items so that they don't go through the normal GC cycle and thus don't accidentally cause

Re: [pylons-discuss] Store class at process start, and use it to initiate inside function?

2018-10-09 Thread Bert JW Regeer
You run the same code at configure time and load it once per process. Even if you do this once at request time or once at configure time you have to do it once per process. > On Oct 9, 2018, at 00:00, Thierry Florac wrote: > > And how do you handle such use case when working in a >

[pylons-discuss] Re: Store class at process start, and use it to initiate inside function?

2018-10-09 Thread Tres Seaver
On 10/09/2018 02:00 AM, Thierry Florac wrote: > And how do you handle such use case when working in a multi-process / > multi-hosts cluster configuration? Fork first, then run the configure step. Forking before creating stateful globals is considered best practice for multi-processing. Tres.

Re: [pylons-discuss] Store class at process start, and use it to initiate inside function?

2018-10-09 Thread Thierry Florac
And how do you handle such use case when working in a multi-process/multi-hosts cluster configuration? Le lun. 8 oct. 2018 à 19:10, Michael Merickel a écrit : > If you are doing loading of data at "first run of the function" then you > have introduced a race condition in your app where unless