I have been using multiprocessing in production for a while and haven't observed any issues.
Leaving multiprocessing.pool() with no arguments would mean it would take the number of cpu cores available by default. On Tue, 29 May 2018, 11:37 am Rohit Kottamasu, <rohit.topmas...@gmail.com> wrote: > Thanks for replying. Are there any issues with using multiprocessing? And > do we need to give the argument for the number of threads in > multiprocessing.pool() function? > > > > On Tue, May 29, 2018 at 11:32 AM, Yacko Abrams <yac...@gmail.com> wrote: > >> Hi Rohit, >> Threads would be slightly slower than multiprocessing. You might have >> issues with sharing variables or GIL. Hence usually multiprocessing is >> preferred over threads in python. >> >> So to answer your question, you can use the second method >> login_threadpool() shown in the code shared, which uses multiprocessing. >> >> (That being said the first method that uses threads could work just fine >> for most purposes) >> >> Regards, >> Yacko >> >> >> On Tue, 29 May 2018, 11:23 am Rohit Kottamasu, <rohit.topmas...@gmail.com> >> wrote: >> >>> Hey, >>> I have written a login script in python for logging into a remote SSH. >>> That is running successfully. I wrote the code in two ways using thread and >>> threadpool. But, I'm unable to understand the exact difference of these two >>> executions. I also want to know which function is more preferred. >>> (login_thread or login_threadpool). What are the advantages and the >>> drawbacks? >>> >>> Thanks >>> -- >>> Regards, >>> Rohit Kottamasu, >>> B.tech Computer Science, >>> Junior Year >>> Shiv Nadar University >>> Blog: https://inkmethoughts.blogspot.in/ >>> _______________________________________________ >>> Chennaipy mailing list >>> Chennaipy@python.org >>> https://mail.python.org/mailman/listinfo/chennaipy >>> >> >> _______________________________________________ >> Chennaipy mailing list >> Chennaipy@python.org >> https://mail.python.org/mailman/listinfo/chennaipy >> >> > > > -- > Regards, > Rohit Kottamasu, > B.tech Computer Science, > Junior Year > Shiv Nadar University > Blog: https://inkmethoughts.blogspot.in/ > _______________________________________________ > Chennaipy mailing list > Chennaipy@python.org > https://mail.python.org/mailman/listinfo/chennaipy >
_______________________________________________ Chennaipy mailing list Chennaipy@python.org https://mail.python.org/mailman/listinfo/chennaipy