Vladimir Akkerman
Vladimir Akkerman

Reputation: 131

python 3 multiprocessing or multithreading?

i have about 50 instances of class, which send SNMP-requests to different devices (one instance per device) every two minutes and save results in their self.variables. What should I use - multiprocessing or multithreading?

Upvotes: 0

Views: 130

Answers (1)

John Zwinck
John Zwinck

Reputation: 249153

You should use neither. Instead, embrace I/O multiplexing. You can easily handle 50 connections sending one message per 120 seconds in a single thread.

There are built-in facilities in Python 3 for this: https://docs.python.org/3.4/library/selectors.html

Upvotes: 1

Related Questions