PIDs an priority

Eduardo Figoli (INS) <>
Wed Mar 1 13:22:15 CET 2006


Thanks Ulf,

Ok that will enter the process as quickly as possible and also make the
process high priority.

Do you know what does imply in ERTS making a process high priority.
I mean, for example 1000 child processes all of the them high priority, will
it be a time when the main process (the one which spawns child processes)
starts queueing messages?  more CPU power to handle thousands with good
response times?


regards, Eduardo

----- Original Message -----
From: "Ulf Wiger" <>
To: "Eduardo Figoli (INS)" <>;
<>
Sent: Monday, February 27, 2006 9:50 PM
Subject: Re: PIDs an priority


Den 2006-02-27 23:16:15 skrev Eduardo Figoli (INS) <>:

> I have seen that ERTS makes priority to spawning processes rather than
> processing the ones already spawned.How does this works in ERTS?

Spawn is an asynchronous operation. The spawned
process will be put in the scheduler queue while
the spawning process continues.

If you wanted to make the spawned process enter as
quickly as possible, you could do something
like this:

start_child() ->
   Pid = spawn_opt(
           fun() -> ... end,
           [{priority, high}, link]),
   erlang:yield(),
   Pid.


--
Ulf Wiger





More information about the erlang-questions mailing list