On Tue, 14 Oct 2008, Maurilio Longo wrote: Hi Maurilio,
> Ok, this goes to the programmer responsability, I can kill a system in a lot > of ways as soon as I start writing something :) But in this case the same program can works in different way on different OSes so it stop to be portable. > > exactly priority modification will cause. There are three main > > settings which change thread priority: > > 1. The frequency of giving CPU time > > 2. The length of periods with CPU time > > 3. The priority in critical sections > And to hide this complexity we create some high level definitions, that simply > guarantee to the harbour programmer that a higher priority will get more > 'power' from the system. It will be his/her care to be sure that his/her > program is not killing the receiving OS. IMHO It does not guaranties anything in OS2 or Windows becasue you cannot controll well the priority in this systems. It's rather feature like: let's try and we see what will happen. Maybe side effects it will not be critical. The same Harbour priority values will make different things in different OSes. > Ok, so let's say we have PRI_IDLE, but as soon as we can go down a step we > need a way to go up a step to return to the regular class of priority and so > we have PRI_REGULAR. This is not a problem of changing priority (though even this is OS dependent and some things will not be fully portable) but replicating compatible behavior between OS-es. The IDLE priority is esy to define as do sth when other threads do nothing and can be quite easy reach in all OSes and such priority does not change other threads behavior. Other states different then regular one will change efectively change the priority of other threads. > Now, we could stop here and, as you say, this could cover 99% of all needs. I > say that we could have a third level, which is PRI_TIMECRITICAL (or any other > name) which gives a boost over PRI_REGULAR (for those cases... let's say a > thread to read a serial port). > I think that such a three levels system would be ok for every real need (apart > from some fancy cases, which can be solved by each programmer writing some C > code). I'll add the interface for priority changing but it should be documented that code which uses it may behaves differently in different OSes. best regards, Przemek _______________________________________________ Harbour mailing list Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour