For the past few years I have been specializing in Google driven development. Its exciting!! I've never had to read a software programming book ever since! It is simple. You should try it too!
Copy! - Once you enter the key words in your requirement in google, you get a list of possible solutions to your problem. You then move your mouse over the first link and click the left button.
Copy(Ctrl-C) anything between flower braces and the sentence before that.
Paste!! - Alt-Tab, Ctrl-V
Comment!!! - within /* .... */ replace the first three '...' with your search words. The fourth '.' is all the punctuation you will need!
Checkin!!! :)
This is maintenance/rewrite friendly too as the guy after you will need just your keywords and the process flow document for GDD!!!
Thursday, May 3, 2007
Semaphores
Implemented semaphores. Each semaphore holds a list of tasks that are waiting on it. You can create one with an initial value N. N is the number of tasks that can concurrently access it. It gets decremented every time a task calls a semaphore. If N is already 0 when a task requests a lock on it, the task has to be suspended. Tested with two tasks. Need to test that more.
Implementing threads should be easy. Something about last words comes to mind :)! In switching a task, you have to switch a whole task out and put the new one in. For threads, you don't have to swap out the context of a task, just the PC and a much faster timer for each thread in the process. So the process TCB struct has to change to accomodate threads.
Finally getting a feel for what a scheduler should look like! It is a state machine duh! Now as far as implementing state machines go, I have no idea :).
Implementing threads should be easy. Something about last words comes to mind :)! In switching a task, you have to switch a whole task out and put the new one in. For threads, you don't have to swap out the context of a task, just the PC and a much faster timer for each thread in the process. So the process TCB struct has to change to accomodate threads.
Finally getting a feel for what a scheduler should look like! It is a state machine duh! Now as far as implementing state machines go, I have no idea :).
Subscribe to:
Comments (Atom)