Welcome, Guest. Please login or register.

Author Topic: Contiki: I wonder....  (Read 6808 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Cymric

  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 1031
    • Show all replies
Re: wow. Talk about different...
« on: April 14, 2005, 11:45:51 AM »
Quote
Tomas wrote:
Quote
Does Contiki support preemptive multi-threading?
Yes. While the Contiki kernel is based on event driven cooperative multitasking, an additional library provides preemptive multi-threading. The reason for not basing the kernel on a preemptive multi-threading model is that it would increase the complexity not only of the operating system, but also of the applications that would run under it. By providing preemptive multi-threading as a library, only programs that explicitly require such functionality will need to pay the extra price.

I think you can do away safely with this library, to me it seems like it was added as a mere curiosity. The kernel does not support pre-emptive scheduling: well, then no application library will give you the Real Thing. I am not saying nót having pre-emptive scheduling is bad---there are applications where you don't need it---just that you should not rely on that library too much (read: at all).
Some people say that cats are sneaky, evil and cruel. True, and they have many other fine qualities as well.
 

Offline Cymric

  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 1031
    • Show all replies
Re: wow. Talk about different...
« Reply #1 on: April 14, 2005, 02:54:48 PM »
Quote
Generale wrote:
It's true. Pre-emptive multitasking is simple.
IIRC it involves the following steps (varies a little from platform to platform) [...] Its what I don't get about contiki. I can only guess why cooperative multitasking was used. Maybe for portability?

If you do not implement pre-emptive sheduling, easy as it is to implement, then you do not have to worry about race conditions and deadlocks. The kernel itself cannot be interrupted at crucial moments. Everything is single-threaded: a resource is either occupied or free, and there is almost no contention to it. These design considerations make cooperative scheduling far cleaner and easier to implement, but it comes at a price: your computer no longer has control over what the programs do.

Quote
And 1.3 seems to be fighting me all the way. Everything I find needs wb/ks 2 or later. I'd like FFS for floppies, and the ability to unmount too.

Forget about 1.3. It's dead, gone, and should be forgotten. Its BCPL legacy makes any decent DOS programming a nightmare. Stick to OS2.x or higher. So much easier and cleaner it hurts.
Some people say that cats are sneaky, evil and cruel. True, and they have many other fine qualities as well.