News for hackers. Stuff that matters.
Re:mTCP: TCP/IP applications for DOS PCs by mbbrutman on Friday July 01, 2022 @03:40PM (#31951673)
Probably not .. that is a diminishing returns kind of thing. If I'm the only user and there are not a lot of programs that need it, it's not worth the effort.

What I have now can best be described as cooperative multitasking with custom contexts. Example: the FTP server and HTTP server keep track of each user connection, provide them a buffer, and know the state of the session and how far into the file they are that is being transferred. (True multithreading would generalize that kind of context as a set of registers and a stack for each thread.)

Re:mTCP: TCP/IP applications for DOS PCs by MrYellowP on Saturday July 02, 2022 @03:07PM (#31961471)
I am talking about actual multithreading using several cores. You don't need to write a scheduler for that or anything fancy.

There's some osdev tutorials about how to enable multiple cores in DOS, iirc. I can dig them out, if you want. You're probably seriously overthinking this.

Right now you're polling, which is fine, because that's how all the high performance software works. One thread pre core, each thread rolling through a list of connections, checking if there's new data.

Re:mTCP: TCP/IP applications for DOS PCs by mbbrutman on Monday July 04, 2022 @07:07PM (#31982626)
Oh, I understood - I've been a professional programmer for close to 30 years, and I've done a lot of operating systems work.

On this platform you have the burden of ensuring that the C runtime is thread safe, or putting locks around it. The same with BIOS calls. And DOS function calls too; you can't have those other CPU cores just blundering in on something that is not reentrant.

And besides, I target this at 16 bit DOS on vintage machines. I've never seen a PCjr or an AT class machine with multiple cores. There were some super expensive 386s at the time that were multi-processors, but those are a fairly rare item.

Re:mTCP: TCP/IP applications for DOS PCs by MrYellowP on Wednesday July 06, 2022 @06:56AM (#31999192)
Oh, I hoped this runs on modern machines too.

DOS isn't limited to old machines ... yet.

Sorry!

Re:mTCP: TCP/IP applications for DOS PCs by mbbrutman on Friday July 08, 2022 @11:22PM (#32031256)
It runs on anything from an 8088 to an emulated virtual machine.

Read the manual ... It's all explained.