Ok, good. Now I've got one gripe sorted out... What about the adition of 5 new keywords/functions and a new datatype to standard C/C++ :-D
You're gonna love this.. :lol: I have far too much free time...
I'm having a horrid time with multithreading... mutexs and semaphores take far more work that I can be bothered with... soooooo, I want to change C/C++ slightly to make my life easier.
My new keywords/functions are:
lock()
unlock()
spawn(function pointer)
int test() (returns true or false)
void wait(flag)
My new datatype is:
flag
Today is the day of reinventing the wheel... :-)
The idea is that all global variable variables/data structures are shared between all threads. But in order to use one, you have to lock() it first (all global variables and data structures must be locked before use). lock() is a synchronous function, so if you lock a global variable which is already locked the prorgam flow will stop until it's unlocked(). You should unlock() the variable after you have used it.
The test() function will test a global variable. If the variable is already locked the function will fail (return false). If it's unlocked, it will be locked() by the function, and will have to be unlocked() for any other thread to use it.
spawn() is simple, it just spawns the function as a thread.
wait() is synchronous and will wait for a flag to be set to true, if the flag is already true it will set the flag to false and continue execution.
Ok bored now... back to my jumptable thing :-D