Mutex vs. Semaphore
Posted: Sat Aug 26, 2006 3:27 pm
So i am to the point that i have software based task switching.
and i have a couple tasks each printing separate things.
but i have noticed that in bochs (but not vmware) stuff being printed to the screen is messed up, sometimes only half of the the text to be printed actually gets printed. and other weird things. so my first idea was to just disable ints upon calling my kprintf. but someone told me that was a bad idea because it disables the cpu for a long time. they suggested mutex/semaphore.
but i am confused on what the difference is between the two.
also, what is non re-entrant code?
and i have a couple tasks each printing separate things.
but i have noticed that in bochs (but not vmware) stuff being printed to the screen is messed up, sometimes only half of the the text to be printed actually gets printed. and other weird things. so my first idea was to just disable ints upon calling my kprintf. but someone told me that was a bad idea because it disables the cpu for a long time. they suggested mutex/semaphore.
but i am confused on what the difference is between the two.
also, what is non re-entrant code?