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 COW on those objects:
https://instagram-engineering.com/copy-on-write-friendly-python-garbage-collection-ad6ed5233ddf > On Oct 9, 2018, at 10:00, Tres Seaver <[email protected]> wrote: > > 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. > -- > =================================================================== > Tres Seaver +1 540-429-0999 [email protected] > Palladion Software "Excellence by Design" http://palladion.com > > -- > You received this message because you are subscribed to the Google Groups > "pylons-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/pylons-discuss/ppij6f%24ol3%241%40blaine.gmane.org. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/BBEECD76-6FA7-439D-B33E-0634F5C15E76%400x58.com. For more options, visit https://groups.google.com/d/optout.
