Pete's Log: ugh
Entry #1125, (Coding, Hacking, & CS stuff)(posted when I was 23 years old.)
I am the biggest idiot in the world. There I am, adding some more stuff to pilsner. Some, but not nearly all, of the new stuff occurs within a critical section of code. So halfway through implementing this stuff, I decide to go ahead and test that which I've already got. Well all of a sudden there's a huge race condition in my code. So I just wasted a good hour trying to track down this stupid race condition, only to realize that the race condition is simply occuring because I added a while loop inside the critical section I was modifying, but never got around to writing the body of said while loop, leading to infinite loops, leading to locks remaining unreleased. Oof. Stupid me. Moral of the story: don't add while(1)-equivalent loops to critical sections of code. And finish implementing a block of code before you try testing it.
I think it's been rather a while since I've written anything into this section of my log. So the story these days: I've written a simplistic PIM Lite assembler, I'm still working on pilsner, and I'm putting a lot of thought into the PIM runtime. Currently my main focus, other than finishing this simulator, is figuring out the exact semantics for all the privileged instructions we're going to need. The opcode field of the PIM Lite instruction has been changed from 5 to 6 bits, so there are now 32 new instructions that can potentially be added. I'm pretty sure that shift instructions are now a certainty, since they make people happy. And I also think I'm going to try to redefine the semantics of the jump instructions, since right now they're less useful than they could be. Hopefully I can get those changes implemented. And then the big one right now is the "trap" or "int" or whatever you want to call it instruction. How do you context switch? I need to figure out what other multithreaded architectures do as far as privilege and context switches and such.
But now the time is near for this year's first NDLUG meeting.