Semaphore (programming)

In computer science, a semaphore is a variable or abstract data type used to control access to a common resource by multiple threads and avoid critical section problems in a concurrent system such as a multitasking operating system. Semaphores are a type of synchronization primitive. A trivial semaphore is a plain variable that is changed (for example, incremented or decremented, or toggled) depending on programmer-defined conditions.

A useful way to think of a semaphore as used in a real-world system is as a record of how many units of a particular resource are available, coupled with operations to adjust that record safely (i.e., to avoid race conditions) as units are acquired or become free, and, if necessary, wait until a unit of the resource becomes available.

Though semaphores are useful for preventing race conditions, they do not guarantee their absence. Semaphores that allow an arbitrary resource count are called counting semaphores, while semaphores that are restricted to the values 0 and 1 (or locked/unlocked, unavailable/available) are called binary semaphores and are used to implement locks.

The semaphore concept was invented by Dutch computer scientist Edsger Dijkstra in 1962 or 1963,[1] when Dijkstra and his team were developing an operating system for the Electrologica X8. That system eventually became known as the THE multiprogramming system.

Library analogy

Suppose a physical library has ten identical study rooms, to be used by one student at a time. Students must request a room from the front desk. If no rooms are free, students wait at the desk until someone relinquishes a room. When a student has finished using a room, the student must return to the desk and indicate that the room is free.

In the simplest implementation, the clerk at the front desk knows only the number of free rooms available. This requires that all of the students use their room while they have signed up for it and return it when they are done. When a student requests a room, the clerk decreases this number. When a student releases a room, the clerk increases this number. The room can be used for as long as desired, and so it is not possible to book rooms ahead of time.

In this scenario, the front desk count-holder represents a counting semaphore, the rooms are the resource, and the students represent processes/threads. The value of the semaphore in this scenario is initially 10, with all rooms empty. When a student requests a room, they are granted access, and the value of the semaphore is changed to 9. After the next student comes, it drops to 8, then 7, and so on. If someone requests a room and the current value of the semaphore is 0,[2] they are forced to wait until a room is freed (when the count is increased from 0). If one of the rooms was released, but there are several students waiting, then any method can be used to select the one who will occupy the room (like FIFO or randomly picking one). And of course, a student must inform the clerk about releasing their room only after really leaving it.

Important observations

When used to control access to a pool of resources, a semaphore tracks only how many resources are free. It does not keep track of which of the resources are free. Some other mechanism (possibly involving more semaphores) may be required to select a particular free resource.

The paradigm is especially powerful because the semaphore count may serve as a useful trigger for a number of different actions. The librarian above may turn the lights off in the study hall when there are no students remaining, or may place a sign that says the rooms are very busy when most of the rooms are occupied.

The success of the protocol requires applications to follow it correctly. Fairness and safety are likely to be compromised (which practically means a program may behave slowly, act erratically, hang, or crash) if even a single process acts incorrectly. This includes:

  • requesting a resource and forgetting to release it;
  • releasing a resource that was never requested;
  • holding a resource for a long time without needing it;
  • using a resource without requesting it first (or after releasing it).

Even if all processes follow these rules, multi-resource deadlock may still occur when there are different resources managed by different semaphores and when processes need to use more than one resource at a time, as illustrated by the dining philosophers problem.

Semantics and implementation

Counting semaphores are equipped with two operations, historically denoted as P and V (see § Operation names for alternative names). Operation V increments the semaphore S, and operation P decrements it.

The value of the semaphore S is the number of units of the resource that are currently available. The P operation wastes time or sleeps until a resource protected by the semaphore becomes available, at which time the resource is immediately claimed. The V operation is the inverse: it makes a resource available again after the process has finished using it. One important property of semaphore S is that its value cannot be changed except by using the V and P operations.

A simple way to understand wait (P) and signal (V) operations is:

  • wait: Decrements the value of the semaphore variable by 1. If the new value of the semaphore variable is negative, the process executing wait is blocked (i.e., added to the semaphore's queue). Otherwise, the process continues execution, having used a unit of the resource.
  • signal: Increments the value of the semaphore variable by 1. After the increment, if the pre-increment value was negative (meaning there are processes waiting for a resource), it transfers a blocked process from the semaphore's waiting queue to the ready queue.

Many operating systems provide efficient semaphore primitives that unblock a waiting process when the semaphore is incremented. This means that processes do not waste time checking the semaphore value unnecessarily.

The counting semaphore concept can be extended with the ability to claim or return more than one "unit" from the semaphore, a technique implemented in Unix. The modified V and P operations are as follows, using square brackets to indicate atomic operations, i.e., operations that appear indivisible to other processes:

function V(semaphore S, integer I):
    [S ← S + I]

function P(semaphore S, integer I):
    repeat:
        [if S ≥ I:
        S ← S − I
        break]

However, the rest of this section refers to semaphores with unary V and P operations, unless otherwise specified.

To avoid starvation, a semaphore has an associated queue of processes (usually with FIFO semantics). If a process performs a P operation on a semaphore that has the value zero, the process is added to the semaphore's queue and its execution is suspended. When another process increments the semaphore by performing a V operation, and there are processes on the queue, one of them is removed from the queue and resumes execution. When processes have different priorities the queue may be ordered thereby, such that the highest priority process is taken from the queue first.

If the implementation does not ensure atomicity of the increment, decrement, and comparison operations, there is a risk of increments or decrements being forgotten, or of the semaphore value becoming negative. Atomicity may be achieved by using a machine instruction that can read, modify, and write the semaphore in a single operation. Without such a hardware instruction, an atomic operation may be synthesized by using a software mutual exclusion algorithm. On uniprocessor systems, atomic operations can be ensured by temporarily suspending preemption or disabling hardware interrupts. This approach does not work on multiprocessor systems where it is possible for two programs sharing a semaphore to run on different processors at the same time. To solve this problem in a multiprocessor system, a locking variable can be used to control access to the semaphore. The locking variable is manipulated using a test-and-set-lock command.

Examples

Trivial example

Consider a variable A and a boolean variable S. A is only accessed when S is marked true. Thus, S is a semaphore for A.

One can imagine a stoplight signal (S) just before a train station (A). In this case, if the signal is green, then one can enter the train station. If it is yellow or red (or any other color), the train station cannot be accessed.

Login queue

Consider a system that can only support ten users (S=10). Whenever a user logs in, P is called, decrementing the semaphore S by 1. Whenever a user logs out, V is called, incrementing S by 1 representing a login slot that has become available. When S is 0, any users wishing to log in must wait until S increases. The login request is enqueued onto a FIFO queue until a slot is freed. Mutual exclusion is used to ensure that requests are enqueued in order. Whenever S increases (login slots available), a login request is dequeued, and the user owning the request is allowed to log in. If S is already greater than 0, then login requests are immediately dequeued.

Producer–consumer problem

In the producer–consumer problem, one process (the producer) generates data items and another process (the consumer) receives and uses them. They communicate using a queue of maximum size N and are subject to the following conditions:

  • the consumer must wait for the producer to produce something if the queue is empty;
  • the producer must wait for the consumer to consume something if the queue is full.

The semaphore solution to the producer–consumer problem tracks the state of the queue with two semaphores: emptyCount, the number of empty places in the queue, and fullCount, the number of elements in the queue. To maintain integrity, emptyCount may be lower (but never higher) than the actual number of empty places in the queue, and fullCount may be lower (but never higher) than the actual number of items in the queue. Empty places and items represent two kinds of resources, empty boxes and full boxes, and the semaphores emptyCount and fullCount maintain control over these resources.

The binary semaphore useQueue ensures that the integrity of the state of the queue itself is not compromised, for example, by two producers attempting to add items to an empty queue simultaneously, thereby corrupting its internal state. Alternatively a mutex could be used in place of the binary semaphore.

The emptyCount is initially N, fullCount is initially 0, and useQueue is initially 1.

The producer does the following repeatedly:

produce:
    P(emptyCount)
    P(useQueue)
    putItemIntoQueue(item)
    V(useQueue)
    V(fullCount)

The consumer does the following repeatedly

consume:
    P(fullCount)
    P(useQueue)
    item ← getItemFromQueue()
    V(useQueue)
    V(emptyCount)

Below is a substantive example:

  1. A single consumer enters its critical section. Since fullCount is 0, the consumer blocks.
  2. Several producers enter the producer critical section. No more than N producers may enter their critical section due to emptyCount constraining their entry.
  3. The producers, one at a time, gain access to the queue through useQueue and deposit items in the queue.
  4. Once the first producer exits its critical section, fullCount is incremented, allowing one consumer to enter its critical section.

Note that emptyCount may be much lower than the actual number of empty places in the queue, for example, where many producers have decremented it but are waiting their turn on useQueue before filling empty places. Note that emptyCount + fullCount ≤ N always holds, with equality if and only if no producers or consumers are executing their critical sections.

Passing the baton pattern

The "Passing the baton" pattern[3][4][5] proposed by Gregory R. Andrews is a generic scheme to solve many complex concurrent programming problems in which multiple processes compete for the same resource with complex access conditions (such as satisfying specific priority criteria or avoiding starvation). Given a shared resource, the pattern requires a private "priv" semaphore (initialized to zero) for each process (or class of processes) involved and a single mutual exclusion "mutex" semaphore (initialized to one). The pseudo-code for each process is:

void process(int proc_id, int res_id)
{
	resource_acquire(proc_id, res_id);
	
	<use the resource res_id>;
	
	resource_release(proc_id, res_id);
}

The pseudo-code of the resource acquisition and release primitives are:

void resource_acquire(int proc_id, int res_id)
{
	P(mutex);
	
	if(<the condition to access res_id is not verified for proc_id>)
	{
		<indicate that proc_id is suspended for res_id>;
		V(mutex);
		P(priv[proc_id]);
		<indicate that proc_id is not suspended for res_id anymore>;
	}
	
	<indicate that proc_id is accessing the resource>;
	
	pass_the_baton(); // See below
}
void resource_release(int proc_id, int res_id)
{
	P(mutex);
	
	<indicate that proc_id is not accessing the resource res_id anymore>;
	
	pass_the_baton(); // See below
}

Both primitives in turn use the "pass_the_baton" method, whose pseudo-code is:

void pass_the_baton(int res_id)
{
	if <the condition to access res_id is true for at least one suspended process>
	{
		int p = <choose the process to wake>;
		V(priv[p]);
	}
	else
	{
		V(mutex);
	}
}

Remarks

The pattern is called "passing the baton" because a process that releases the resource as well as a freshly reactivated process will activate at most one suspended process, that is, shall "pass the baton to it". The mutex is released only when a process is going to suspend itself (resource_acquire), or when pass_the_baton is unable to reactivate another suspended process.

Operation names

The canonical names V and P come from the initials of Dutch words. V is generally explained as verhogen ("increase"). Several explanations have been offered for P, including proberen ("to test" or "to try"),[6] passeren ("pass"), and pakken ("grab"). Dijkstra's earliest paper on the subject[1] gives passering ("passing") as the meaning for P, and vrijgave ("release") as the meaning for V. It also mentions that the terminology is taken from that used in railroad signals. Dijkstra subsequently wrote that he intended P to stand for prolaag,[7] short for probeer te verlagen, literally "try to reduce", or to parallel the terms used in the other case, "try to decrease".[8][9][10]

In ALGOL 68, the Linux kernel,[11] and in some English textbooks, the V and P operations are called, respectively, up and down. In software engineering practice, they are often called signal and wait,[12] release and acquire[12] (standard Java library),[13] or post and pend. Some texts call them vacate and procure to match the original Dutch initials.[14][15]

Semaphores vs. mutexes

A mutex is a locking mechanism that sometimes uses the same basic implementation as the binary semaphore. However, they differ in how they are used. While a binary semaphore may be colloquially referred to as a mutex, a true mutex has a more specific use-case and definition, in that only the task that locked the mutex is supposed to unlock it. This constraint aims to handle some potential problems of using semaphores:

  1. Priority inversion: If the mutex knows who locked it and is supposed to unlock it, it is possible to promote the priority of that task whenever a higher-priority task starts waiting on the mutex.
  2. Premature task termination: Mutexes may also provide deletion safety, where the task holding the mutex cannot be accidentally deleted. [citation needed]
  3. Termination deadlock: If a mutex-holding task terminates for any reason, the OS can release the mutex and signal waiting tasks of this condition.
  4. Recursion deadlock: a task is allowed to lock a reentrant mutex multiple times as it unlocks it an equal number of times.
  5. Accidental release: An error is raised on the release of the mutex if the releasing task is not its owner.

See also

References

  1. ^ a b Dijkstra, Edsger W. Over de sequentialiteit van procesbeschrijvingen (EWD-35) (PDF). E.W. Dijkstra Archive. Center for American History, University of Texas at Austin. (transcription) (undated, 1962 or 1963)
  2. ^ The Little Book of Semaphores Allen B. Downey
  3. ^ Andrews, Gregory R. (1999). Foundations of Multithreaded, Parallel, and Distributed Programming. Addison-Wesley.
  4. ^ Carver, Richard H.; Thai, Kuo-Chung (2005). Modern Multithreading: Implementing, Testing, and Debugging Multithreaded Java and C++/Pthreads/Win32 Programs. Wiley.
  5. ^ Maurer, Christian (2021). Nonsequential and Distributed Programming with Go. Springer.
  6. ^ Silberschatz, Abraham; Galvin, Peter Baer; Gagne, Greg (2008), Operating System Concepts (8th ed.), John Wiley & Sons. Inc, p. 234, ISBN 978-0-470-12872-5
  7. ^ Dijkstra, Edsger W. EWD-74 (PDF). E.W. Dijkstra Archive. Center for American History, University of Texas at Austin. (transcription)
  8. ^ Dijkstra, Edsger W. MULTIPROGAMMERING EN DE X8 (EWD-51) (PDF). E.W. Dijkstra Archive. Center for American History, University of Texas at Austin. (transcription) (in Dutch)
  9. ^ Dijkstra's own translation reads "try-and-decrease", although that phrase might be confusing for those unaware of the colloquial "try-and..."
  10. ^ (PATCH 1/19) MUTEX: Introduce simple mutex implementation Linux Kernel Mailing List, 19 December 2005
  11. ^ Linux Kernel hacking HOWTO Archived 2010-05-28 at the Wayback Machine LinuxGrill.com
  12. ^ a b Mullender, Sape; Cox, Russ (2008). Semaphores in Plan 9 (PDF). 3rd International Workshop on Plan 9.
  13. ^ java.util.concurrent.Semaphore
  14. ^ "exec.library/Procure". amigadev.elowar.com. Retrieved 2016-09-19.
  15. ^ "exec.library/Vacate". amigadev.elowar.com. Retrieved 2016-09-19.

Introductions

References

Read other articles:

سباق باريس روبيه 2020 تفاصيل السباقسلسلة118. سباق باريس روبيهمنافسةطواف العالم للدراجات 2020 1.UWT‏التاريخ25 أكتوبر 2020المسافات259 كمالبلد فرنسانقطة البدايةكومبييننقطة النهايةروبيهالفرق25المنصةالفائزتم إلغاء السباق  [لغات أخرى]‏ ▶20192021◀ توثيق سباق باريس روبيه 2020 (…

New York City Subway service New York City Subway serviceQueens Boulevard/ Sixth Avenue LocalMiddle Village–Metropolitan Avenue-bound M train of R160s leaving Myrtle AvenueNorthern endClockwise direction:Forest Hills–71st Avenue (weekday rush hours and middays)Essex Street (Weekday evenings and weekends except late nights)Myrtle Avenue (late nights)Southern endCounterclockwise direction: Middle Village–Metropolitan AvenueStations3613 (Weekday evening and weekend daytime service)8…

This article is written like a personal reflection, personal essay, or argumentative essay that states a Wikipedia editor's personal feelings or presents an original argument about a topic. Please help improve it by rewriting it in an encyclopedic style. (December 2013) (Learn how and when to remove this message) Part of a series onPolitical andlegal anthropology Basic concepts Status and rank Ascribed status Achieved status Social status Caste Age grade/Age set Leveling mechanism Leadership Big…

Premier League Malti 1971-1972 Competizione Premier League Malti Sport Calcio Edizione 57ª Organizzatore MFA Luogo  Malta Partecipanti 10 Formula 1 girone all'italiana Risultati Vincitore  Sliema Wanderers Statistiche Incontri disputati 181 Gol segnati 157 (0,87 per incontro) Cronologia della competizione 1970-71 1972-73 Manuale Il campionato era formato da dieci squadre e lo Sliema Wanderers vinse il titolo. Classifica finale Pos. Squadra G V N P GF GS Punti 1 Sliema Wanderers 1…

Ujung BatuDesaPeta lokasi Desa Ujung BatuNegara IndonesiaProvinsiKalimantan SelatanKabupatenTanah LautKecamatanPelaihariKode pos70851Kode Kemendagri63.01.03.2017 Luas21,00 Km²Jumlah penduduk2.655 Jiwa (2008)Kepadatan126 Jiwa/Km² Ujung Batu adalah nama sebuah desa di Kecamatan Pelaihari, Kabupaten Tanah Laut, Kalimantan Selatan, Indonesia. Pranala luar (Indonesia) Keputusan Menteri Dalam Negeri Nomor 050-145 Tahun 2022 tentang Pemberian dan Pemutakhiran Kode, Data Wilayah Administrasi Peme…

WalesAssociationWelsh Netball AssociationConfederationNetball Europe (Europe)Head coachEmily HandysideAsst coachSarah LewisCaptainSuzy DraneNia JonesVice-captainClare JonesElla Powell-DaviesWorld ranking8 Red uniform Green uniform First internationalEngland  25 – 3  Wales(played 1949)Netball World Cup2019 placingDNQBest result6th (1975, 1979)Commonwealth Games2018 placing11thBest result6th (2002) The Wales national netball team represents Wales in international netball competitio…

犹太人יהודים‎(Yehudim)雅各耶稣大卫王爱因斯坦马克思迈蒙尼德弗拉维奥·约瑟夫斯弗洛伊德斯宾诺莎本-古里安西奥多·赫茨尔娜塔莉·波特曼弗里茨·哈伯冯诺依曼門德爾頌谢尔盖·布林罗莎·卢森堡莉泽·迈特纳乔姆斯基维特根斯坦大卫·李嘉图尼尔斯·玻尔赛尔曼·瓦克斯曼卡夫卡史翠珊泽连斯基罗莎琳德·富兰克林古斯塔夫·马勒普鲁斯特卡米耶·毕沙罗涂尔干摩西埃…

Державний комітет телебачення і радіомовлення України (Держкомтелерадіо) Приміщення комітетуЗагальна інформаціяКраїна  УкраїнаДата створення 2003Керівне відомство Кабінет Міністрів УкраїниРічний бюджет 1 964 898 500 ₴[1]Голова Олег НаливайкоПідвідомчі орг…

贝内德托·贝蒂诺·克拉克西Bettino Craxi第45任意大利总理任期1983年8月4日—1987年4月17日总统亚历山德罗·佩尔蒂尼 弗朗切斯科·科西加副职阿纳尔多·福拉尼前任阿明托雷·范范尼继任阿明托雷·范范尼 个人资料出生(1934-02-24)1934年2月24日伦巴第米兰逝世2000年1月19日(2000歲—01—19)(65歲)突尼斯哈马麦特国籍意大利政党意大利社会党儿女Bobo、Stefania 克拉克西在突尼斯的墓地。 贝…

Para otros usos de este término, véase Santiago de Chile (desambiguación). Santiago Capital de Chile De arriba a abajo, de izquierda a derecha.1.ª fila: Panorámica de Santiago. 2.ª fila: Estatua de la Inmaculada Concepción en el Santuario del cerro San Cristóbal, y Sanhattan, principal distrito financiero de la ciudad. 3.ª fila: Fuente de Neptuno en el cerro Santa Lucía, y Biblioteca Nacional. 4.ª fila: Casas centrales de la Universidad de Chile y Pontificia Universidad Católica de C…

Senyummu adalah TangiskuSutradaraDasri YacobProduserLeonita SutopoDitulis olehDasri YacobPemeranRano KarnoAnita Carolina MohedeFarida PashaRuslan BsrieAnna TairasSofia AmangSandra CiptadiSimon CaderZainal AbidinSukarno M. NoorPenata musikNuskan SyariefPenyuntingSK SyamsuriDistributorPT. Inem FilmTanggal rilis1980Durasi112 menitNegaraIndonesia Senyummu adalah Tangisku adalah film Indonesia tahun 1980 dengan disutradarai oleh Dasri Yacob dan dibintangi oleh Rano Karno dan Anita Carolina Mohe…

الأوضاع القانونية لزواج المثليين زواج المثليين يتم الاعتراف به وعقده هولندا1 بلجيكا إسبانبا كندا جنوب أفريقيا النرويج السويد المكسيك البرتغال آيسلندا الأرجنتين الدنمارك البرازيل فرنسا الأوروغواي نيوزيلندا3 المملكة المتحدة4 لوكسمبورغ الولايات المتحدة5 جمهورية أيرلندا كو…

This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Pictures in the Sky – news · newspapers · books · scholar · JSTOR (December 2009) (Learn how and when to remove this message) 1987 studio album by Rich MullinsPictures in the SkyStudio album by Rich MullinsReleasedFebruary 23, 1987RecordedApril 6–8, 1986…

II-divisioona 2016II-divisioona Competizione Campionato finlandese di football americano Sport Football americano Edizione 23ª Organizzatore SAJL Date dal 14 maggio 2016al 21 agosto 2016 Luogo  Finlandia Partecipanti 5 Formula Girone all'italiana e playoff Sede finale Porin urheilukeskus, Pori Risultati Vincitore  Mikkeli Bouncers(1º titolo) Secondo  Pori Bears Semi-finalisti  Nokia Ghosthunters Statistiche Incontri disputati 22 Punti segnati 796 (36,18 per inc…

Building in Manhattan, New York 122 East 23rd StreetGeneral informationTypeMixed-useCoordinates40°44′22″N 73°59′08″W / 40.739350°N 73.985493°W / 40.739350; -73.985493Technical detailsFloor count18Floor area275,387 square feet (25,584.3 m2)Design and constructionArchitect(s)Rem Koolhaas 121 East 22nd (also 122 East 23rd Street) is a building in the Gramercy Park neighborhood of Manhattan in New York City. Developed by American company Toll Brothers, it is …

British Labour politician (born 1954) Andrew DismoreDismore in 2015Member of the London Assembly for Barnet and CamdenIn office4 May 2012 – 6 May 2021Preceded byBrian ColemanSucceeded byAnne ClarkeMember of Parliament for HendonIn office1 May 1997 – 12 April 2010Preceded byConstituency CreatedSucceeded byMatthew Offord Personal detailsBorn (1954-09-02) 2 September 1954 (age 69)Bridlington, East Riding of Yorkshire, EnglandPolitical partyLabourAlma materLondon School of…

American actor Gordon JonesGordon Jones in I Take This Oath (1940)Born(1912-04-05)April 5, 1912Alden, Iowa, U.S.DiedJune 20, 1963(1963-06-20) (aged 51)Tarzana, California, U.S.Alma materUniversity of California at Los Angeles[1]OccupationActorYears active1931–1963SpouseLucile Van Winkle (1935–1940)[2] Gordon Wynnivo Jones (April 5, 1912 – June 20, 1963)[3] was an American character actor, a member of John Wayne's informal acting company best known…

Overview of the cinema of Latvia Cinema of LatviaCinema Gaisma in ValmieraNo. of screens63 (2011)[1] • Per capita3.4 per 100,000 (2011)[1]Main distributorsForum Cinemas 57.5%Acme Film Latvia 16.5%Incognito Films 5.6[2]Produced feature films (2011)[3]Fictional4Animated1Documentary1Number of admissions (2011)[5]Total1,879,149 • Per capita1.13 (2012)[4]National films66,337 (3.5%)Gross box office (2011)[5]…

Tekle Giyorgis IKaisar EtiopiaBerkuasa1779–1800PendahuluSalomon IIPenerusDemetrosKelahiranSekitar 1751 (1751)Kematian12 Desember 1817 (umur 66)WangsaDinasti SalomoAgamaGereja Ortodoks Etiopia Tekle Giyorgis I (bahasa Amhara: ተክለ ጊዮርጊስ? Tumbuhan Santo Georgius; sekitar 1751 – 12 Desember 1817[1]) adalah Kaisar Etiopia dengan masa kekuasaan yang berselang-seling pada periode 20 Juli 1779 hingga 1800. Penguasa dari Dinasti Salomo ini tercatat pernah berkuasa seb…

Kutu kepala Klasifikasi ilmiah Kerajaan: Animalia Filum: Arthropoda Kelas: Insecta Ordo: Siphonaptera Famili: Pulicidae Subfamili: Pulicinae Genus: Pulex Spesies: P. irritans Nama binomial Pulex irritansLinnaeus, 1758 Kutu kepala adalah sejenis parasit pengisap darah yang biasanya hidup di bagian kepala. Kutu betina mampu bertelur enam buah sehari. Telur ini selalu melekat dengan kuat pada rambut. Telur-telur ini akan menetas setelah kurang lebih 8 hari. Kutu rambut ini sangat senang tingga…