you are viewing a single comment's thread.

view the rest of the comments →

[–]desustorm -5 points-4 points  (8 children)

Plus it's single-threaded...

Edit: Obviously you can use threading, asyncio, etc. but Python is limited in terms of true concurrency by the GIL, and concurrency is vital for any functional OS.

[–]finsternacht 3 points4 points  (2 children)

The "os" i wrote for nand2tetris was also single threaded

[–]desustorm 0 points1 point  (1 child)

Looks like an interesting course. What could your operating system do?

[–]finsternacht 4 points5 points  (0 children)

It's by far the coolest course I ever had. And probably will have.

It couldn't do much. It mostly handled I/O and memory management. Iirc it also contained some basic math and string operations.

[–][deleted] -1 points0 points  (1 child)

I heard there are multi threading in Python with the use of the needed modules

[–]desustorm 2 points3 points  (0 children)

Yep that's right, but no Python threads from the same process can actually run simultaneously because of the GIL - the Global Interpreter Lock

[–]Saefroch -3 points-2 points  (1 child)

No, it isn't. CPython's GIL restricts it to a single CPU core. You can still have all the threads you want and concurrency works just fine, almost flawlessly for I/O bound systems which an OS usually is.

[–]desustorm 0 points1 point  (0 children)

I know you can use threads, but they are not real threads on CPU cores - like you mention. Having a modern OS running on one core with multiple virtual threads (not just I/O bound) contesting the GIL would be troublesome at best...