This is a fix for issue #3, which is not so benign after all, since even if the result is correct, it wastes a potentially substantial amount of ressources. It seems that others noted that the access to an [Lwt_stream] should sometimes be protected by a mutex : https://github.com/avsm/mirage/blob/master/lib/std/lwt_stream.ml#L35
I am not claiming the fix is the best possible, and I have very little experience with concurrent programming/lwt. I'd be happy to discuss the patch further if you see some potential pitfalls.
This is a fix for issue #3, which is not so benign after all, since even if the result is correct, it wastes a potentially substantial amount of ressources. It seems that others noted that the access to an [Lwt_stream] should sometimes be protected by a mutex : https://github.com/avsm/mirage/blob/master/lib/std/lwt_stream.ml#L35
I am not claiming the fix is the best possible, and I have very little experience with concurrent programming/lwt. I'd be happy to discuss the patch further if you see some potential pitfalls.