multiprocessing article on PYMOTW - subclassing with 'def run' and 'logging'
Veek M
veek at dont-use-this.com
Sat Nov 16 09:19:09 EST 2019
https://pymotw.com/2/multiprocessing/basics.html
https://pymotw.com/2/threading/
I didn't follow this
1.
>The logger can also be configured through the logging configuration file
>API, using the name multiprocessing.
and
2.
>it is also possible to use a custom subclass.
> import multiprocessing
> class Worker(multiprocessing.Process):
> def run(self):
> print 'In %s' % self.name
> return
therefore, how is 'def run' going to start a process? 'run' may be
autocalled same as in 'threading' but in threading, the function is the
Thread.. so you can do your work in def run: and expect it to be suitably
threaded
whereas here.. does he somehow magically convert a function to a process?
More information about the Python-list
mailing list