On Tue, 2011-07-05 at 17:05 +0200, Jäkel, Guido wrote: > >> is lxc-start threadsave, i.e. may a start up different containers in > >> parallel? Have I to apply a individual value for 'lxc.rootfs.mount', > >> e.g. by use of the process id or 'mktemp'. Or something else, more? > > > >Ah, you're mixing apples and oranges here. Starting up two containers > >in parallel means you are running lxc-start twice and that's two full > >heavy-weight processes, no threads required and nothing to do with > >requiring threat-safe. > > Your'e completely right, that 'thread-save' wasn't the right term. And > of corse, booting a bunch of containers by sequential calls of > lxc-start will take not significant more time than doing it in > parallel -- because most of the lauch time is spend by the Linux > bootstrapping. > > But I want to know it for another reason: If I going to write > automated scripts to lauch some containers, they might be called "at > the same time" (in terms of the lauch time of lxc before forking the > init). And therefore I ask if I have to avoid a possible race > condition by any kind of semaphore or is it safe to lauch it more than > one time.
Yeah, I do it all the time. Your problem will not be race conditions but it could be crushing your poor host if you try to do too many at once. You might want to stick a load average check in there just to protect yourself. If you don't want to hold up the boot process, fork your main loop into the background and include the load average check inside the main loop. > Guido Regards, Mike -- Michael H. Warfield (AI4NB) | (770) 985-6132 | m...@wittsend.com /\/\|=mhw=|\/\/ | (678) 463-0932 | http://www.wittsend.com/mhw/ NIC whois: MHW9 | An optimist believes we live in the best of all PGP Key: 0x674627FF | possible worlds. A pessimist is sure of it!
signature.asc
Description: This is a digitally signed message part
------------------------------------------------------------------------------ All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of 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-d2d-c2
_______________________________________________ Lxc-users mailing list Lxc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-users