Perl Cd Bookshelf [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Perl Cd Bookshelf [Electronic resources] - نسخه متنی

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید



8.212. Thread::Semaphore


Provides a mechanism to regulate access
to resources. Semaphores are more general than locks because they
aren't tied to a particular scalar. They can have
values other than 0 or 1 and
can be incremented or decremented by a specified number.

new


$sem = new Thread::Semaphore([val])

Constructor. Creates a new semaphore object, with an optional initial
count of val, or 1 if
val isn't specified.

down


down [number]

Decrements the semaphore's count by the specified
number, which defaults to 1. If the resulting
count would be negative, blocks until the
semaphore's count has been increased to be equal to
or larger than the amount you want to decrease it.

up


up [number]

Increments the semaphore's count by the specified
number, which defaults to 1. If a thread is
blocked waiting to decrement the count, and the increment brings the
count high enough, the blocked thread is unblocked.



8.211. Thread::Queue8.213. Thread::Signal




Copyright © 2002 O'Reilly & Associates. All rights reserved.

/ 875