The problem with a user-mode library is that there's no quick and easy way to turn it into a good driver. You can re-wrap it into a standard API like WinSock, or you can port the algorithms into kernel code.But how much is the first one relevant to ReactOS?
Wrapping the whole thing into WinSock would be complicated as all hell, as there are probably all sorts of things that don't play nice with each other on a design level. For example, mTCP probably does direct system calls, while WinSock actually delegates a lot of functionality to the AFD DLL. Just with that difference, we're talking about trying to split mTCP into two different parts. Imagine the myriad of smaller things that could go wrong when trying to wrap a library that wasn't designed to be wrapped.
The second solution, porting the algorithms, is extremely labor-intensive. First, one must read through and thoroughly understand the code one is trying to port. Second, one must turn user code into kernel code. User code can take all sorts of liberties because they enjoy access to standard libraries and memory protection. Since all kernel code runs in the same address space, kernel code must also obey some very strict rules to not crash the rest of the system or cause huge performance problems. For one, kernel code needs to understand exactly when it is allowed to deallocate a chunk of memory, something user code can have some liberty with. Locking also works very differently in kernel mode, since you can directly control processor state, thereby affecting interrupts and scheduling. Porting any algorithm from user to kernel mode requires a lot of thought and a lot of testing.
Isn't that what this forum is for, discussion? I don't think you failed anything, I think it was good of you to bring up mTCP and start a productive discussion like this. I certainly learned a few important things while reading that paper, and I'm sure you've learned a few things from all the other posts people have made here.I tried to accent namely this -- maybe you or someone else could get some nice ideas for handling concurency. Eg. the use of Shared Memory seemed to me handy in this aspect. I am sorry if I failed.
Thank you!Wish you best luck in bringing clarity on the subject! And have a great weekend:)