Answer the question
In order to leave comments, you need to log in
Python communication between processes via Pipes?
Greetings Toaster Members!
Please explain one point, when using Pipes, there is one caveat in the documentation that data can be corrupted if two or more processes use the same end of the pipe.
That is, do I understand correctly that there should be one and only one consumer that calls recv () from the pipe, but there can be one or more Producers, despite the fact that the order of data arrival is unimportant.
Or still adhere to a strict Producer-Consumer scheme.
And one more question: the Producer sends data by calling the send() function, can the Consumer immediately read this data, or until the Producer closes the pipe (close()), the data will not be available to the Consumer?
Answer the question
In order to leave comments, you need to log in
That is, do I understand correctly that the consumer should be one and only one
A little off topic, but is it possible to use Queue along with asyncio, to prevent races in shared data, with several routes.
And another question. The other day I got acquainted offhand with asynchronous programming in Python, in fact everything is done in one thread, it just effectively distributes processor time between tasks (correct if it’s not right or inaccurate), so that’s why synchronization primitives are needed, such as Lock, Event, Condition , Semaphore (in asyncio module) if only one thread has access at a time?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question