README.sched 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. Notes on the scheduler in sched.c:
  2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  3. 'sched.c' provides an very simplistic multi-threading scheduler.
  4. See the example, function 'sched(...)', in the same file for its
  5. API usage.
  6. Until an exhaustive testing can be done, the implementation cannot
  7. qualify as that of production quality. It works with the example
  8. in 'sched.c', it may or may not work in other cases.
  9. Limitations:
  10. ~~~~~~~~~~~~
  11. - There are NO primitives for thread synchronization (locking,
  12. notify etc).
  13. - Only the GPRs and FPRs context is saved during a thread context
  14. switch. Other registers on the PowerPC processor (60x, 7xx, 7xxx
  15. etc) are NOT saved.
  16. - The scheduler is NOT transparent to the user. The user
  17. applications must invoke thread_yield() to allow other threads to
  18. scheduler.
  19. - There are NO priorities, and the scheduling policy is round-robin
  20. based.
  21. - There are NO capabilities to collect thread CPU usage, scheduler
  22. stats, thread status etc.
  23. - The semantics are somewhat based on those of pthreads, but NOT
  24. the same.
  25. - Only seven threads are allowed. These can be easily increased by
  26. changing "#define MAX_THREADS" depending on the available memory.
  27. - The stack size of each thread is 8KBytes. This can be easily
  28. increased depending on the requirement and the available memory,
  29. by increasing "#define STK_SIZE".
  30. - Only one master/parent thread is allowed, and it cannot be
  31. stopped or deleted. Any given thread is NOT allowed to stop or
  32. delete itself.
  33. - There NOT enough safety checks as are probably in the other
  34. threads implementations.
  35. - There is no parent-child relationship between threads. Only one
  36. thread may thread_join, preferably the master/parent thread.
  37. (C) 2003 Arun Dharankar <ADharankar@ATTBI.Com>