downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

pcntl_setpriority> <pcntl_get_last_error
[edit] Last updated: Fri, 24 May 2013

view this page in

pcntl_getpriority

(PHP 5)

pcntl_getpriorityBir sürecin önceliğini döndürür

Açıklama

int pcntl_getpriority ([ int $pid = getmypid() [, int $süreç_türü = PRIO_PROCESS ]] )

pid ile belirtilen sürecin öncelik seviyesini döndürür. Öncelik seviyeleri sistem türüne ve çekirdeğe göre farklılık gösterdiğinden ayrıntılı bilgi için sisteminizdeki setpriority(2) kılavuz sayfasına bakınız.

Değiştirgeler

pid

Belirtilmezse işlevi çağıran sürecin süreç kimliği kullanılır.

süreç_türü

PRIO_PGRP, PRIO_USER ve PRIO_PROCESS sabitlerinden biri.

Dönen Değerler

Hata durumunda FALSE yoksa belirtilen sürecin öncelik seviyesini döndürür. Düşük sayısal değerler daha yüksek öncelik sağlar.

Uyarı

Bu işlev mantıksal FALSE değeriyle dönebileceği gibi FALSE olarak değerlendirilebilecek mantıksal olmayan bir değerle de dönebilir. Bu konuda daha fazla bilgi edinmek için Mantıksal Değerler bölümüne bakabilirsiniz. Bu işlevden dönen değeri sınamak için === işlecini kullanınız.

Ayrıca Bakınız



add a note add a note User Contributed Notes pcntl_getpriority - [1 notes]
up
0
jonathan at jcdesigns dot com
5 years ago
This function is ideal for checking if a given process is running, I have seen solutions that involve running the system utilites like PS and parsing the answer, which should work fine, but this allows you to check a given PID with a single call

function CheckPID( $PID )
{
        // Check if the passed in PID represents a vlaid process in the system
        // Returns true if it does
        // Turn off non-fatal runtime warning for a moment as we know we
        // will get one if the PID does not represent a valid process
 
    $oldErrorLevel = error_reporting(0);
    error_reporting( $oldErrorLevel & ~E_WARNING );
    $res = pcntl_getpriority($PID);
    error_reporting( $oldErrorLevel);
    return ! ( $res === false);
}

 
show source | credits | stats | sitemap | contact | advertising | mirror sites