[erlang-questions] Subtle behaviour of Erlang scheduler

Sun May 27 18:59:31 CEST 2007

On Sun, May 27, 2007 at 12:54:44AM +0200, Robert Virding wrote:

> > Or to think about a priority inheritance/ceiling system. If we think 
> > that a gen_server is something like an object and that a gen_server:call 
> > is something like a method call, it is reasonable to assume that a 
> > process receiving a message handles it running with the same priority of 
> > the sending process. That is, not only the receiving process uses the 
> > reductions left by the sending proces, but also its priority. This 
> > should definitively solve the problem by means of a state-of-art approach.
> That could be devasting to a system if a critical server inherits the 
> priority of the process which sent it a message. A low priority process 
> could then block the system by sending messages to critical servers, 
> which would then be blocked by normal level processes and potentially 
> hang the system.

Yes, but what about letting a process to inherit caller's priority 
*only in case the caller has a higher priority* ?

In this way, if a high priority process sends messages to a low
priority one, the latter inherits high priority, speeding-up the
execution of code triggered by the incoming message. On the other
hand, if a low-priority process sends a message to a high-priority
one, nothing happens: The high priority process serves the message,
without changing its priority level.

It is true that priority levels are not widely used in the majority of
actual Erlang applications, but priority inversion, as explained
above, can sensibly speed-up execution in massively concurrent



[ Enzo Nicosia aka KatolaZ --- GLUG Catania -- Freaknet Medialab ]
[ me [at] katolaz.homeunix.net -- http://katolaz.homeunix.net -- ]
[ GNU/Linux User:#325780/ICQ UIN: #258332181/GPG key ID 0B5F062F ]
[ Fingerprint: 8E59 D6AA 445E FDB4 A153 3D5A 5F20 B3AE 0B5F 062F ]

More information about the erlang-questions mailing list