Using gevent and multiprocessing to communicate with a subprocess

Question:

Can I efficiently use the multiprocessing module with gevent on Windows?

Scenario:

I have a pyvent based gevent based application that does asynchronous I / O on Windows. The application is mainly related to I / O, but there are peaks with more CPU utilization. This application will have to manage the console application through stdin and stdout. I cannot change this console application, and the user will be able to use his own, only a fixed communication protocol based on a string (string).

I have a working implementation using subprocess and threads, but I would prefer to move all the communication code based on the subprocess along with these threads to a separate process in order to return the main application to single-threaded. I plan to use a multiprocessor module for this.

Previous reading:

I searched a lot on the Internet and read some source code, so I know that the multiprocessor module uses a named pipe-based implementation of Windows in pipes. A pair of multiprocessing.queue.Queue objects will be used to communicate with the second Python process. These queues are based on the implementation of this pipe, for example. IPC will run through named pipes.

, gevent . - , , , gevent , -.

, Windows, , , . , IPC Windows . , , , , , gevent.

, , . .

+5
2

Queue get . - , , , . , . , - , /API -. gevent Python, libevent C Boost ASIO ++.

-, . , :

  • . - IPC, , . stdin stdout.
  • , , .
  • Gevent / .

, , , . .

, , TCP/IP. . , IPC , . , , , , Python .

fancy - ZeroC ICE. , . CORBA, . , , , . , , Python, Java, ++ .. , . , .

, . !

+1

. , http://gehrcke.de/gipc, , , . , ( Windows). Process (, join()) gevent-cooperative. . Windows IPC , POSIX- ( - ). IPC .

0

All Articles