ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: denf@novosoft.ru
To: mandrake-russian@linuxteam.iplabs.ru
Subject: Re: [mdk-re]  Процессы
Date: Mon Jan 29 13:54:01 2001
Message-ID: <OF5186E8F9.E0931AA5-ONC62569E3.003A8339@novosoft.ru> (raw)


01/29/2001 03:21:40 PM mandrake-russian-admin wrote:
>denf@novosoft.ru wrote:
>>  Все просто: постоянное увеличение на 1 - это самый быстрый способ
>> выделения свободных pid (если не поддерживать список свободных:
конечно),
>> когда дойдет до самого большого, начнет с начала, причем, большинство из
>> начальных процессов уже умерли и выделение опять будет быстрым.
>
>Hello!!
>
>Я правильно понял, что когда зашкалило число процессов, то работает
>алгоритм типа:
>
>last_enabled_pid=1; # вызывается только при зашкаливании
>
>for (n=last_enabled_pid+1; n<=max_pid; n++)
>    {
>    if (n != занято_активным_процессом) exit;     # если большинство
>древних
>процессов уже ушли то скорее всего сразу же будет exit.
>    }
>new_pid = n;
>last_enabled_pid=n; # используется при следующих вызовах for
>
>
>В сильно упрощенном варианте верно?
Не знаю, как на самом деле ;), но думаю, что близко к истине с некоторыми
поправками:
  при переходе через максимум нужно начать с низу
  последние несколько процессов могут быть созданы только рутом
  ну и при исчерпании всех процессов алгоритм не должен зацикливаться


                 reply	other threads:[~2001-01-29 13:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=OF5186E8F9.E0931AA5-ONC62569E3.003A8339@novosoft.ru \
    --to=denf@novosoft.ru \
    --cc=mandrake-russian@linuxteam.iplabs.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git