I have some questions about networking. This isn't specific to any particular socket api, just theoretical. To create a 2-way chat system each client must be able to send and receive data. Ideally, they'd always be waiting for data. When the data comes it'll get output to the screen. Also ideally, they'd always be able to send data. So while data is being received it is also being sent.
Is it possible to implement this without multi-threading? I'm thinking:
So if data is sent (ie. the user typed in some text and hit enter) the event handler will pass off the message to the send() function. The recv() function would work parallel to this.Code:"chatProcess"'s process descriptor block (PDB) status: blocked reason: waiting for data to be sent, waiting for data to arrive.
(So if the data sent flag and the data arrive flag were set almost at the exact same time it would be handled by a que, whichever arriving first being processed first)
As you can see this is not multi-threading. So is this possible on modern operating systems? Or is multi-threading preferred?
Any articles/books you'd recommend?