Here's a read callback that will block the backend for an hour:
void my_read_callback(string data) { sleep(3600); }
Horrible. How should we change the language to ensure that this program is impossible to write? Who cares if we break a lot of legitimate programs, as long as we fix this terrible "bug" in the backend?
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Previous text:
2003-03-19 15:31: Subject: I/O callbacks in blocking mode
I don't have a really strong opinion on that, but I think it makes sense to make it difficult to get into that mode of operation by mistake.
I expect the backend not to block, ever, so it is fair if the backend (or some other part of the callback machinery) complains if I'm using it in such a way that it no longer can guarantee that.
I have no problem if there's a documented way to say "do what I say, I'll take the responsibility of designing my protocols and clients in such a way that they won't deadlock", but it's not something I'll recommend in general, as it puts part of the responsibility for server security (that the server shouldn't hang) onto the clients.
Where possible, the pike interface should hide the difficulties and subtle problems of the operating system services.
/ Niels Möller ()