The Art of Multiprocessor Programming 2nd Edition Maurice Herlihy 2024 Scribd Download
The Art of Multiprocessor Programming 2nd Edition Maurice Herlihy 2024 Scribd Download
com
https://ebookmass.com/product/the-art-of-multiprocessor-
programming-2nd-edition-maurice-herlihy/
OR CLICK BUTTON
DOWNLOAD NOW
https://ebookmass.com/product/the-art-of-multiprocessor-programming-
second-edition-maurice-herlihy/
ebookmass.com
https://ebookmass.com/product/oncoplastic-surgery-of-the-breast-2nd-
edition-maurice-y-nahabedian/
ebookmass.com
https://ebookmass.com/product/the-art-of-computer-programming-
combinatorial-algorithms-donald-knuth/
ebookmass.com
https://ebookmass.com/product/the-awk-programming-language-2nd-
edition-aho/
ebookmass.com
Colour in Art (World of Art) 2nd Edition John Gage
https://ebookmass.com/product/colour-in-art-world-of-art-2nd-edition-
john-gage/
ebookmass.com
https://ebookmass.com/product/the-art-of-assembly-language-
programming-using-pic-technology-core-fundamentals-theresa-schousek-2/
ebookmass.com
https://ebookmass.com/product/the-art-of-assembly-language-
programming-using-pic-technology-core-fundamentals-theresa-schousek/
ebookmass.com
https://ebookmass.com/product/the-art-of-computer-programming-
volume-4b-combinatorial-algorithms-part-2-donald-e-knuth/
ebookmass.com
https://ebookmass.com/product/the-design-of-the-unix-operating-system-
maurice-j-bach/
ebookmass.com
The Art of
Multiprocessor
Programming
The Art of
Multiprocessor
Programming
Second Edition
Maurice Herlihy
Nir Shavit
Victor Luchangco
Michael Spear
Morgan Kaufmann is an imprint of Elsevier
50 Hampshire Street, 5th Floor, Cambridge, MA 02139, United States
Copyright © 2021 Elsevier Inc. All rights reserved.
No part of this publication may be reproduced or transmitted in any form or by any means, electronic
or mechanical, including photocopying, recording, or any information storage and retrieval system,
without permission in writing from the publisher. Details on how to seek permission, further
information about the Publisher’s permissions policies and our arrangements with organizations such
as the Copyright Clearance Center and the Copyright Licensing Agency, can be found at our website:
www.elsevier.com/permissions.
This book and the individual contributions contained in it are protected under copyright by the
Publisher (other than as may be noted herein).
Notices
Knowledge and best practice in this field are constantly changing. As new research and experience
broaden our understanding, changes in research methods, professional practices, or medical treatment
may become necessary.
Practitioners and researchers must always rely on their own experience and knowledge in evaluating
and using any information, methods, compounds, or experiments described herein. In using such
information or methods they should be mindful of their own safety and the safety of others, including
parties for whom they have a professional responsibility.
To the fullest extent of the law, neither the Publisher nor the authors, contributors, or editors, assume
any liability for any injury and/or damage to persons or property as a matter of products liability,
negligence or otherwise, or from any use or operation of any methods, products, instructions, or ideas
contained in the material herein.
ISBN: 978-0-12-415950-1
For Noun and Aliza, Shafi, Yonadav, and Lior, and for Luisa.
– N.S.
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix
Suggested ways to teach the art of multiprocessor programming . . . . . . . . . . . xxi
CHAPTER 1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 Shared objects and synchronization . . . . . . . . . . . . . . . . . . . . 3
1.2 A fable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.2.1 Properties of a mutual exclusion protocol . . . . . . . . . . 8
1.2.2 The moral . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.3 The producer–consumer problem . . . . . . . . . . . . . . . . . . . . . . 9
1.4 The readers–writers problem . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.5 The harsh realities of parallelization . . . . . . . . . . . . . . . . . . . . 12
1.6 Parallel programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.7 Chapter notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.8 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
PART 1 Principles
CHAPTER 2 Mutual exclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.1 Time and events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.2 Critical sections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.3 Two-thread solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.3.1 The LockOne class . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.3.2 The LockTwo class . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.3.3 The Peterson lock . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.4 Notes on deadlock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.5 The filter lock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
2.6 Fairness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.7 Lamport’s Bakery algorithm . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.8 Bounded timestamps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.9 Lower bounds on the number of locations . . . . . . . . . . . . . . . 39
2.10 Chapter notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
2.11 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
CHAPTER 3 Concurrent objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
3.1 Concurrency and correctness . . . . . . . . . . . . . . . . . . . . . . . . . 49
3.2 Sequential objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
3.3 Sequential consistency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
3.3.1 Sequential consistency versus real-time order . . . . . . . 55
3.3.2 Sequential consistency is nonblocking . . . . . . . . . . . . . 56
vii
viii Contents
3.3.3 Compositionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
3.4 Linearizability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
3.4.1 Linearization points . . . . . . . . . . . . . . . . . . . . . . . . . . 58
3.4.2 Linearizability versus sequential consistency . . . . . . . . 59
3.5 Quiescent consistency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
3.5.1 Properties of quiescent consistency . . . . . . . . . . . . . . . 60
3.6 Formal definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
3.6.1 Histories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
3.6.2 Linearizability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
3.6.3 Linearizability is compositional . . . . . . . . . . . . . . . . . . 63
3.6.4 Linearizability is nonblocking . . . . . . . . . . . . . . . . . . . 63
3.7 Memory consistency models . . . . . . . . . . . . . . . . . . . . . . . . . 64
3.8 Progress conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
3.8.1 Wait-freedom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
3.8.2 Lock-freedom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
3.8.3 Obstruction-freedom . . . . . . . . . . . . . . . . . . . . . . . . . . 66
3.8.4 Blocking progress conditions . . . . . . . . . . . . . . . . . . . 67
3.8.5 Characterizing progress conditions . . . . . . . . . . . . . . . 67
3.9 Remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
3.10 Chapter notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
3.11 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
CHAPTER 4 Foundations of shared memory . . . . . . . . . . . . . . . . . . 75
4.1 The space of registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
4.2 Register constructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
4.2.1 Safe MRSW registers . . . . . . . . . . . . . . . . . . . . . . . . . 82
4.2.2 A regular Boolean MRSW register . . . . . . . . . . . . . . . 83
4.2.3 A regular M-valued MRSW register . . . . . . . . . . . . . . 84
4.2.4 An atomic SRSW register . . . . . . . . . . . . . . . . . . . . . . 85
4.2.5 An atomic MRSW register . . . . . . . . . . . . . . . . . . . . . 87
4.2.6 An atomic MRMW register . . . . . . . . . . . . . . . . . . . . . 90
4.3 Atomic snapshots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
4.3.1 An obstruction-free snapshot . . . . . . . . . . . . . . . . . . . . 92
4.3.2 A wait-free snapshot . . . . . . . . . . . . . . . . . . . . . . . . . . 93
4.3.3 Correctness arguments . . . . . . . . . . . . . . . . . . . . . . . . 97
4.4 Chapter notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
4.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
CHAPTER 5 The relative power of primitive synchronization
operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
5.1 Consensus numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
5.1.1 States and valence . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
5.2 Atomic registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
5.3 Consensus protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
5.4 FIFO queues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Contents ix
PART 2 Practice
CHAPTER 7 Spin locks and contention . . . . . . . . . . . . . . . . . . . . . . . 147
7.1 Welcome to the real world . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
7.2 Volatile fields and atomic objects . . . . . . . . . . . . . . . . . . . . . . 150
7.3 Test-and-set locks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
7.4 Exponential back-off . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
7.5 Queue locks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
7.5.1 Array-based locks . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
7.5.2 The CLH queue lock . . . . . . . . . . . . . . . . . . . . . . . . . . 159
7.5.3 The MCS queue lock . . . . . . . . . . . . . . . . . . . . . . . . . . 161
7.6 A queue lock with timeouts . . . . . . . . . . . . . . . . . . . . . . . . . . 163
7.7 Hierarchical locks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
7.7.1 A hierarchical back-off lock . . . . . . . . . . . . . . . . . . . . 167
7.7.2 Cohort locks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
7.7.3 A cohort lock implementation . . . . . . . . . . . . . . . . . . . 170
7.8 A composite lock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
7.9 A fast path for threads running alone . . . . . . . . . . . . . . . . . . . 178
7.10 One lock to rule them all . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
7.11 Chapter notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
7.12 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
CHAPTER 8 Monitors and blocking synchronization . . . . . . . . . . . 183
8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
8.2 Monitor locks and conditions . . . . . . . . . . . . . . . . . . . . . . . . . 183
8.2.1 Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
8.2.2 The lost-wakeup problem . . . . . . . . . . . . . . . . . . . . . . 187
8.3 Readers–writers locks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
8.3.1 Simple readers–writers lock . . . . . . . . . . . . . . . . . . . . 190
8.3.2 Fair readers–writers lock . . . . . . . . . . . . . . . . . . . . . . . 192
x Contents
Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541
Preface
In the decade since the first edition, this book has become a staple of undergraduate
and graduate courses at universities around the world. It has also found a home on
the bookshelves of practitioners at companies large and small. The audience for the
book has, in turn, advanced the state of the art in multiprocessor programming. In
this second edition, we aim to continue this “virtuous cycle” by providing new and
updated content. Our goal is the same as with the first edition: to provide a textbook
for a senior-level undergraduate course and a reference for practitioners.
Organization
The first part of this book covers the principles of concurrent programming, show-
ing how to think as a concurrent programmer, developing fundamental skills such
as understanding when operations “happen,” considering all possible interleavings,
and identifying impediments to progress. Like many skills—driving a car, cooking
a meal, or appreciating caviar—thinking concurrently must be cultivated, and it can
be learned with moderate effort. Readers who want to start programming right away
may skip most of this section but should still read Chapters 2 and 3, which cover the
basic ideas necessary to understand the rest of the book.
We first look at the classic mutual exclusion problem (Chapter 2). This chapter
is essential for understanding why concurrent programming is a challenge. It covers
basic concepts such as fairness and deadlock. We then ask what it means for a con-
current program to be correct (Chapter 3). We consider several alternative conditions
and the circumstances under which one might want to use each one. We examine
the properties of shared memory essential to concurrent computation (Chapter 4),
and we look at the kinds of synchronization primitives needed to implement highly
concurrent data structures (Chapters 5 and 6).
We think it is essential that anyone who wants to become truly skilled in the art
of multiprocessor programming spend time solving the problems presented in the
first part of this book. Although these problems are idealized, they distill the kind
of thinking necessary to write effective multiprocessor programs. Most importantly,
they distill the style of thinking necessary to avoid the common mistakes committed
by nearly all novice programmers when they first encounter concurrency.
The second part of the book describes the practice of concurrent programming.
For most of this part, we give examples in Java to avoid getting mired in low-level
details. However, we have expanded this edition to include discussion of some low-
level issues that are essential to understanding multiprocessor systems and how to
program them effectively. We use examples in C++ to illustrate these issues.
xv
Discovering Diverse Content Through
Random Scribd Documents
authority whatever in his own country; for as serki-n-turáwa he had
to levy the tax of ten mithkáls on every camel-load of merchandise,
and this he is said to have done with some degree of severity. After
a long conversation on the steps of the terrace, we parted, the best
possible friends.
Not so pleasant to me, though not without interest, was the visit
of another great man—Belróji, the támberi or war-chieftain of the
Ighólar Im-esághlar. He was still in his prime, but my Kél-owí (who
were always wrangling like children) got up a desperate fight with
him in my very room, which was soon filled with clouds of dust; and
the young Slimán entered during the row, and joining in it, it
became really frightful. The Kél-owí were just like children; when
they went out they never failed to put on all their finery, which they
threw off as soon as they came within doors, resuming their old dirty
clothes.
It was my custom in the afternoon, when the sun had set behind
the opposite buildings, to walk up and down in front of our house;
and while so doing to-day I had a long conversation with two chiefs
of the Itísan on horseback, who came to see me, and avowed their
sincere friendship and regard. They were fine, tall men, but rather
slim, with a noble expression of countenance and of light colour.
Their dress was simple but handsome, and arranged with great care.
All the Tuarek, from Ghát as far as Háusa, and from Alákkos to
Timbúktu, are passionately fond of the tobes and trousers called
“tailelt” (the Guinea-fowl), or “filfil” (the pepper), on account of their
speckled colour. They are made of silk and cotton interwoven, and
look very neat. The lowest part of the trousers, which forms a
narrow band about two inches broad, closing rather tightly, is
embroidered in different colours. None of the Tuarek of pure blood
would, I think, degrade themselves by wearing on their head the red
cap.
Monday, October 21.—Early in the morning I went with Hámma to
take leave of the Sultan, who had been too busy for some days to
favour me with an audience; and I urged my friend to speak of the
treaty though I was myself fully aware of the great difficulty which
so complicated a paper, written in a form entirely unknown to the
natives, and which must naturally be expected to awaken their
suspicion, would create, and of the great improbability of its being
signed while the Sultan was pressed with a variety of business. On
the way to the fáda we met Áshu, the present serki-n-turáwa, a
large-sized man, clad in an entirely white dress, which may not
improbably be a sign of his authority over the white men (Turáwa).
He is said to be a very wealthy man. He replied to my compliments
with much kindness, entered into conversation with me about the
difference of our country and theirs, and ordered one of his
companions to take me to a small garden which he had planted near
his house in the midst of the town, in order to see what plants we
had in common with them. Of course there was nothing like our
plants; and my cicerone conceived rather a poor idea of our country
when he heard that all the things which they had we had not—
neither senna, nor bamia, nor indigo, nor cotton, nor Guinea-corn,
nor, in short, the most beautiful of all trees of the creation, as he
thought—the talha, or Mimosa ferruginea; and he seemed rather
incredulous when told that we had much finer plants than they.
We then went to the fáda. The Sultan seemed quite ready for
starting. He was sitting in the courtyard of his palace, surrounded by
a multitude of people and camels, while the loud murmuring noise of
a number of schoolboys who were learning the Kurán proceeded
from the opposite corner, and prevented my hearing the
conversation of the people. The crowd and the open locality were, of
course, not very favourable to my last audience, and it was
necessarily a cold one. Supported by Hámma, I informed the Sultan
that I expected still to receive a letter from him to the Government
under whose auspices I was travelling, expressive of the pleasure
and satisfaction he had felt in being honoured with a visit from one
of the mission, and that he would gladly grant protection to any
future traveller who should happen to visit his country. The Sultan
promised that such a letter should be written; however, the result
proved that either he had not quite understood what I meant, or,
what is more probable, that in his precarious situation he felt himself
not justified in writing to a Christian government, especially as he
had received no letter from it.
When I had returned to my quarters, Hámma brought me three
letters, in which ʿAbd el Káder recommended my person and my
luggage to the care of the Governors of Kanó, Kátsena, and Dáura,
and which were written in rather incorrect Arabic, and in nearly the
same terms. They were as follows:—
These letters were all sealed with the seal of the Sultan.
Hámma showed me also another letter which he had received
from the Sultan, and which I think interesting enough to be here
inserted, as it is a faithful image of the turbulent state of the country
at that time, and as it contains the simple expression of the sincere
and just proceedings of the new Sultan. Its purport was as follows,
though the language in which it is written is so incorrect that several
passages admit of different interpretations:—
“In the name of God, etc.
“From the Commander, the faithful Minister of Justice, the
Sultan ʿAbd el Káder, son of the Sultan Mohammed el Bákeri,
to the chiefs of all the tribe of Eʾ Núr, and Hámed, and Sëis,
and all those among you who have large possessions, perfect
peace to you.
“Your eloquence, compliments, and information are
deserving of praise. We have seen the auxiliaries sent to us
by your tribe, and we have taken energetic measures with
them against the marauders, who obstruct the way of the
caravans of devout people, and the intercourse of those who
travel, as well as those who remain at home. On this account
we desire to receive aid from you against their incursions.
The people of the Kél-fadaye, they are the marauders. We
should not have prohibited their chiefs to exercise rule over
them, except for three things: first, because I am afraid they
will betake themselves from the Aníkel [the community of the
people of Aír] to the Awelímmiden; secondly, in order that
they may not make an alliance with them against us, for they
are all marauders; and thirdly, in order that you may approve
of their paying us the tribute. Come, then, to us quickly. You
know that what the hand holds it holds only with the aid of
the fingers; for without the fingers the hand can seize
nothing.
“We therefore will expect your determination, that is to say
your coming, after the departure of the salt-caravan of the
Itísan, fixed among you for the fifteenth of the month. God!
God is merciful and answereth prayer! Come therefore to us,
and we will tuck up our sleeves, and drive away the
marauders, and fight valiantly against them as God (be He
glorified!) hath commanded.
“Lo, corruption hath multiplied on the face of the earth!
May the Lord not question us on account of the poor and
needy, orphans and widows, according to His word: ‘You are
all herdsmen, and ye shall all be questioned respecting your
herds, whether ye have indeed taken good care of them or
dried them up.’
“Delay not, therefore, but hasten to our residence, where
we are all assembled; for ‘zeal in the cause of religion is the
duty of all;’ or send thy messenger to us quickly with a
positive answer; send thy messenger as soon as possible.
Farewell!”
The whole population was in alarm, and everybody who was able
to bear arms prepared for the expedition. About sunset the “égehen”
left the town, numbering about four hundred men, partly on camels,
partly on horseback, besides the people on foot. Bóro as well as
Áshu accompanied the Sultan, who this time was himself mounted
on a camel. They went to take their encampment near that of
Astáfidet, in Tagúrast, ʿAbd el Káder pitching a tent of grey colour,
and in size like that of a Turkish aghá, in the midst of the Kél-gerés,
the Kél-ferwán, and the Emgedesíye; while Astáfidet, who had no
tent, was surrounded by the Kél-owí. The Sultan was kind and
attentive enough not to forget me even now; and having heard that
I had not yet departed, Hámma not having finished his business in
the town, he sent me some wheat, a large botta with butter and
vegetables (chiefly melons and cucumbers), and the promise of
another sheep.
In the evening the drummer again went his rounds through the
town, proclaiming the strict order of the Sultan that everybody
should lay in a large supply of provisions. Although the town in
general had become very silent when deserted by so many people,
our house was kept in constant bustle, and in the course of the night
three mehára came from the camp, with people who could get no
supper there, and sought it with us. Bóro sent a messenger to me
early the next morning, urgently begging for a little powder, as the
“Mehárebín” of the Imghád had sent off their camels and other
property, and were determined to resist the army of the Sultan.
However, I could send him but very little. My amusing friend
Mohammed spent the whole day with us, when he went to join the
ghazzia. I afterwards learnt that he obtained four head of cattle as
his share. There must be considerable herds of cattle in the more
favoured valleys of Asben; for the expedition had nothing else to live
upon, as Mohammed afterwards informed me, and slaughtered an
immense quantity of them. Altogether, the expedition was
successful, and the Fádë-ang and many tribes of the Imghád lost
almost all their property. Even the influential Háj Beshír was
punished, on account of his son having taken part in the expedition
against us. I received also the satisfactory information that ʿAbd el
Káder had taken nine camels from the man who retained my méheri;
but I gained nothing thereby, neither my own camel being returned
nor another given me in its stead. The case was the same with all
our things; but nevertheless the proceeding had a good effect,
seeing that people were punished expressly for having robbed
Christians, and thus the principle was established that it was not less
illegal to rob Christians than it was to rob Mohammedans, both
creeds being placed, as far as regards the obligations of peace and
honesty, on equally favourable terms.
Tuesday, October 22.—I spent the whole of Tuesday in my house,
principally in taking down information which I received from the
intelligent Ghadámsi merchant Mohammed, who, having left his
native town from fear of the Turks, had resided six years in Ágades,
and was a well-informed man.
Wednesday, October 23.—My old friend the blacksmith Hámmeda,
and the tall Elíyas, went off this morning with several camels laden
with provisions, while Hámma still stayed behind to finish the
purchases; for on account of the expedition, and the insecure state
of the road to Damerghú, it had been difficult to procure provisions
in sufficient quantity. Our house therefore became almost as silent
and desolate as the rest of the town; but I found a great advantage
in remaining a few days longer, for my chivalrous friend and
protector, who, as long as the Sultan and the great men were
present, had been very reserved and cautious, had now no further
scruple about taking me everywhere, and showing me the town
“within and without.”
We first visited the house of Ídder,
a broker, who lived at a short distance
to the south from our house, and had
also lodged Háj ʿAbdúwa during his
stay here. It was a large, spacious
dwelling, well arranged with a view to
comfort and privacy, according to the
conception and customs of the
inhabitants, while our house (being a
mere temporary residence for Ánnur’s
people occasionally visiting the town)
was a dirty, comfortless abode. We
entered first a vestibule, about twenty-five feet long and nine broad,
having on each side a separate space marked off by that low kind of
balustrade mentioned in my description of the Sultan’s house. This
vestibule or ante-room was followed by a second room of larger size
and irregular arrangement; opposite the entrance it opened into
another apartment, which, with two doors, led into a spacious inner
courtyard, which was very irregularly circumscribed by several rooms
projecting into it, while to the left it was occupied by an enormous
bedstead (1). These bedsteads are a most characteristic article of
furniture in all the dwellings of the Sónghay. In Ágades they are
generally very solidly built of thick boards, and furnished with a
strong canopy resting upon four posts, covered with mats on the top
and on three sides, the remaining side being shut in with boards.
Such a canopied bed looks like a little house by itself. On the wall of
the first chamber, which on the right projected into the courtyard,
several lines of large pots had been arranged, one above the other
(2), forming so many warm nests for a number of turtle-doves which
were playing all about the courtyard; while on the left, in the half-
decayed walls of two other rooms (3), about a dozen goats were
fastened each to a separate pole. The background of the courtyard
contained several rooms, and in front of it a large shade (4) had
been built of mats, forming a rather pleasant and cool resting-place.
Numbers of children were gambolling about, who gave to the whole
a very cheerful appearance. There is something very peculiar in
these houses, which are constructed evidently with a view to
comfort and quiet enjoyment.
We then went to visit a female friend of Hámma, who lived in the
south quarter of the town, in a house which likewise bespoke much
comfort; but here, on account of the number of inmates, the
arrangement was different, the second vestibule being furnished on
each side with a large bedstead instead of mats, though here also
there was in the courtyard an immense bedstead. The courtyard was
comparatively small, and a long corridor on the left of it led to an
inner courtyard or “tsakangída,” which I was not allowed to see. The
mistress of the house was still a very comely person, although she
had borne several children. She had a fine figure, though rather
under the middle size, and a fair complexion. I may here remark that
many of the women of Ágades are not a shade darker than Arab
women in general. She wore a great quantity of silver ornaments,
and was well dressed in a gown of coloured cotton and silk. Hámma
was very intimate with her, and introduced me to her as his friend
and protégé, whom she ought to value as highly as himself. She was
married, but her husband was residing in Kátsena, and she did not
seem to await his return in the Penelopean style. The house had as
many as twenty inmates, there being no less than six children, I
think, under five years of age, and among them a very handsome
little girl, the mother’s favourite; besides, there were six or seven
full-grown slaves. The children were all naked, but wore ornaments
of beads and silver.
After we had taken leave of this Emgedesíye lady, we followed the
street towards the south, where there were some very good houses,
although the quarter in general was in ruins; and here I saw the
very best and most comfortable-looking dwelling in the town. All the
pinnacles were ornamented with ostrich eggs. One will often find in
an eastern town, after the first impression of its desolate appearance
is gone by, many proofs that the period of its utter prostration is not
yet come, but that even in the midst of the ruins there is still a good
deal of ease and comfort. Among the ruins of the southern quarter
are to be seen the pinnacled walls of a building of immense
circumference and considerable elevation; but unfortunately I could
not learn from Hámma for what purpose it had been used; however,
it was certainly a public building, and probably a large khán rather
than the residence of the chief. With its high, towering walls, it still
forms a sort of outwork on the south side of the town, where in
general the wall is entirely destroyed, and the way is everywhere
open. Hámma had a great prejudice against this desolate quarter.
Even the more intelligent Mohammedans are often afraid to enter
former dwelling-places of men, believing them to be haunted by
spirits; but he took me to some inhabited houses, which were all
built on the same principle as that described, but varying greatly in
depth and in the size of the courtyard; the staircases (abi-n-háwa)
leading to the upper story are in the courtyard, and are rather
irregularly built of stones and clay. In some of them young ostriches
were running about. The inhabitants of all the houses seemed to
have the same cheerful disposition, and I was glad to find scarcely a
single instance of misery. I give here the ground-plan of another
house.
The artisans who work in leather (an
occupation left entirely to females) seem to live
in a quarter by themselves, which originally was
quite separated from the rest of the town by a
sort of gate; but I did not make a sufficient
survey of this quarter to mark it distinctly on the
ground-plan of the town. We also visited some
of the mat-makers.
Our maimólo of the other day, who had
discovered that we had slaughtered our sheep,
paid us a visit in the evening, and for a piece of meat entertained
me with a clever performance on his instrument, accompanied with
a song. Hámma spent his evening with our friend the Emgedesíye
lady, and was kind enough to beg me to accompany him. This I
declined, but gave him a small present to take to her.
I had a fair sample of the state of morals in Ágades the following
day, when five or six girls and women came to pay me a visit in our
house, and with much simplicity invited me to make merry with
them, there being now, as they said, no longer reason for reserve,
“as the Sultan was gone.” It was indeed rather amusing to see what
conclusions they drew from the motto “Serki yátafi.” Two of them
were tolerably pretty and well-formed, with fine black hair hanging
down in plaits or tresses, lively eyes, and very fair complexion. Their
dress was decent, and that of one of them even elegant, consisting
of an under-gown reaching from the neck to the ankles, and an
upper one drawn over the head, both of white colour; but their
demeanour was very free, and I too clearly understood the caution
requisite in a European who would pass through these countries
unharmed and respected by the natives, to allow myself to be
tempted by these wantons. It would be better for a traveller in these
regions, both for his own comfort and for the respect felt for him by
the natives, if he could take his wife with him; for these simple
people do not understand how a man can live without a partner. The
Western Tuarek, who in general are very rigorous in their manners,
and quite unlike the Kél-owí, had nothing to object against me
except my being a bachelor. But as it is difficult to find a female
companion for such journeys, and as by marrying a native he would
expose himself to much trouble and inconvenience on the score of
religion, he will do best to maintain the greatest austerity of
manners with regard to the other sex, though he may thereby
expose himself to a good deal of derision from some of the lighter-
hearted natives. The ladies, however, became so troublesome that I
thought it best to remain at home for a few days, and was thus
enabled at the same time to note down the information which I had
been able to pick up. During these occupations I was greatly pleased
with the companionship of a diminutive species of finches which
frequent all the rooms in Ágades, and, as I may add from later
experience, in Timbúktu also; the male, with its red neck, in
particular looks extremely pretty. The poults were just about to
fledge.
Sunday, October 27.—There was one very characteristic building in
the town, which, though a most conspicuous object from the terrace
of our house, I had never yet investigated with sufficient accuracy.
This was the mesállaje, or high tower rising over the roof of the
mosque. The reason why this building in particular (the most famous
and remarkable one in the town) had been hitherto observed by me
only from a distance, and in passing by, must be obvious. Difference
of religious creed repelled me from it; and so long as the town was
full of strangers, some of them very fanatical, it was dangerous for
me to approach it too closely. I had often inquired whether it would
not be possible to ascend the tower without entering the mosque;
but I had always received for answer that the entrance was locked
up. As soon, however, as the Sultan was gone, and when the town
became rather quiet, I urged Hámma to do his best that I might
ascend to the top of this curious building, which I represented to
him as a matter of the utmost importance to me, since it would
enable me not only to control my route by taking a few angles of the
principal elevations round the valley Aúderas, but also to obtain a
distant view over the country towards the west and south, which it
was not my good luck to visit myself. To-day Hámma promised me
that he would try what could be done.
Having once more visited the lively house of Ídder, we took our
way over the market-places, which were now rather dull. The
vultures looked out with visible greediness and eagerness from the
pinnacles of the ruined walls around for their wonted food—their
share of offal during these days, when so many people were absent,
being of course much reduced, though some of them probably had
followed their fellow-citizens on the expedition. So few people being
in the streets, the town had a more ruined look than ever, and the
large heap of rubbish accumulated on the south side of the butchers’
market seemed to me more disgusting than before. We kept along
the principal street between Dígi and Arrafíya, passing the deep well
Shedwánka on our right, and on the other side a school, which
resounded with the shrill voices of about fifty little boys repeating
with energy and enthusiasm the verses of the Kurán, which their
master had written for them upon their little wooden tablets. Having
reached the open space in front of the mosque, and there being
nobody to disturb me, I could view at my leisure this simple but
curious building, which in the subsequent course of my journey
became still more interesting to me, as I saw plainly that it was built
on exactly the same principle as the tower which rises over the
sepulchre of the famed conqueror Háj Mohammed Áskiá (the
“Ischia” of Leo).
The mesállaje starts up from the platform or terrace formed by the
roof of the mosque, which is extremely low, resting apparently, as
we shall see, in its interior, upon four massive pillars. It is square,
and measures at its base about thirty feet, having a small lean-to, on
its east side, on the terrace of the mosque, where most probably
there was formerly the entrance. From this the tower rises
(decreasing in width, and with a sort of swelling or entasis in the
middle of its elevation, something like the beautiful model adopted
by nature in the deléb palm, and imitated by architects in the
columns of the Ionic and Corinthian orders) to a height of from
ninety to ninety-five feet. It measures at its summit not more than
about eight feet in width. The interior is lighted by seven openings
on each side. Like most of the houses in Ágades, it is built entirely of
clay; and in order to strengthen a building so lofty and of so soft a
material, its four walls are united by thirteen layers of boards of the
dúm-tree, crossing the whole tower in its entire breadth and width,
and coming out on each side from three to four feet, while at the
same time they afford the only means of getting to the top. Its
purpose is to serve as a watch-tower, or at least was so at a former
time, when the town, surrounded by a strong wall and supplied with
water, was well capable of making resistance, if warned in due time
of an approaching danger. But at present it seems rather to be kept
in repair only as a decoration of the town.
The mesállaje in its present state was only six years old at the
time of my visit (in 1850), and perhaps was not even quite finished
in the interior, as I was told that the layers of boards were originally
intended to support a staircase of clay. About fifty paces from the
south-western corner of the mosque, the ruins of an older tower are
seen still rising to a considerable height, though leaning much to one
side, more so than the celebrated Tower of Pisa, and most probably
in a few years it will give way to an attack of storm and rain. This
more ancient tower seems to have stood quite detached from the
mosque.
Having sufficiently surveyed the exterior of the tower, and made a
sketch of it, I accompanied my impatient companion into the interior
of the mosque, into which he felt no scruple in conducting me. The
lowness of the structure had already surprised me from without; but
I was still more astonished when I entered the interior, and saw that
it consisted of low, narrow naves, divided by pillars of immense
thickness, the reason of which it is not possible at present to
understand, as they have nothing to support but a roof of dúm-tree
boards, mats, and a layer of clay; but I think it scarcely doubtful that
originally these naves were but the vaults or cellars of a grand
superstructure, designed but not executed; and this conjecture
seems to be confirmed by all that at present remains of the mosque.
The gloomy halls were buried in a mournful silence, interrupted only
by the voice of a solitary man, seated on a dirty mat at the western
wall of the tower, and reading diligently the torn leaves of a
manuscript. Seeing that it was the kádhi, we went up to him and
saluted him most respectfully; but it was not in the most cheerful
and amiable way that he received our compliments—mine in
particular—continuing to read, and scarcely raising his eyes from the
sheets before him. Hámma then asked for permission to ascend the
tower, but received a plain and unmistakable refusal, the thing being
impossible, there being no entrance to the tower at present. It was
shut up, he said, on account of the Kél-gerés, who used to ascend
the tower in great numbers. Displeased with his uncourteous
behaviour, and seeing that he was determined not to permit me to
climb the tower, were it ever so feasible, we withdrew and called
upon the imám, who lives in a house attached to these vaults, and
which looked a little neater from having been whitewashed;
however, he had no power to aid us in our purpose, but rather
confirmed the statement of the kádhi. This is the principal mosque
of the town, and seems to have been always so, although there are
said to have been formerly as many as seventy mosques, of which
ten are still in use. They deserve no mention, however, with the
exception of three, the Msíd Míli, Msíd Éheni, and Msíd el Mékki. I
will only add here that the Emgedesíye, so far as their very slender
stock of theological learning and doctrine entitles them to rank with
any sect, are Malekíye, as well as the Kél-owí.
Resigning myself to the disappointment of not being able to
ascend the tower, I persuaded my friend to take a longer walk with
me round the northern quarter of the town. But I forgot to mention
that besides Hámma, I had another companion of a very different
character. This was Zúmmuzuk, a reprobate of the worst description,
and whose features bore distinct impress of the vile and brutal
passions which actuated him; yet being a clever fellow, and (as the
illegitimate son, or “dan néma,” of an Emgédesi woman) fully master
of the peculiar idiom of Ágades, he was tolerated not only by the old
chief Ánnur, who employed him as interpreter, but even by me. How
insolent the knave could be I shall soon have occasion to mention.
With this fellow, therefore, and with Hámma, I continued my walk,
passing the kófa-n-alkáli, and then, from the ruins of the quarter
Ben-Gottára, turning to the north. Here the wall of the town is in a
tolerable state of preservation, but very weak and insufficient,
though it is kept in repair, even to the pinnacles, on account of its
surrounding the palace of the Sultan. Not far from this is an open
space called Azarmádarangh, “the place of execution,” where
occasionally the head of a rebellious chieftain or a murderer is cut
off by the “dóka;” but as far as I could learn, such things happen
very seldom. Even on the north side, two gates are in a tolerable
state of preservation.
Having entered the town from this side, we went to visit the
quarter of the leather-workers, which, as I stated before, seems to
have formed originally a regular ward; all this handicraft, with the
exception of saddle-work, is carried on by women, who work with
great neatness. Very beautiful provision-bags are made here,
although those which I brought back from Timbúktu are much
handsomer. We saw also some fine specimens of mats, woven of a
very soft kind of grass, and dyed of various colours. Unfortunately, I
had but little with me wherewith to buy; and even if I had been able
to make purchases, the destination of our journey being so distant,
there was not much hope of carrying the things safely to Europe.
The blacksmiths’ work of Ágades is also interesting, although showy
and barbarous, and not unlike the work with which the Spaniards
used to adorn their long daggers.
Monday, October 28.—During all this time I prosecuted inquiries
with regard to several subjects connected with the geography and
ethnography of this quarter of the world. I received several visits
from Emgédesi tradesmen, many of whom are established in the
northern provinces of Háusa, chiefly in Kátsena and Tasáwa, where
living is infinitely cheaper than in Ágades. All these I found to be
intelligent men, having been brought up in the centre of intercourse
between a variety of tribes and nations of the most different
organization, and, through the web of routes which join here,
receiving information of distant regions. Several of them had even
made the pilgrimage, and thus come in contact with the relatively
high state of civilization in Egypt and near the coast; and I shall not
easily forget the enlightened view which the mʿallem Háj
Mohammed ʿOmár, who visited me several times, took of Islamism
and Christianity. The last day of my stay in Ágades, he reverted to
the subject of religion, and asked me, in a manner fully expressive of
his astonishment, how it came to pass that the Christians and
Moslemín were so fiercely opposed to one another, although their
creeds, in essential principles, approximated so closely. To this I
replied by saying that I thought the reason was that the great
majority both of Christians and Moslemín paid less regard to the
dogmas of their creeds than to external matters, which have very
little or no reference to religion itself. I also tried to explain to him
that in the time of Mohammed Christianity had entirely lost that
purity which was its original character, and that it had been mixed up
with many idolatrous elements, from which it was not entirely
disengaged till a few centuries ago, while the Mohammedans had
scarcely any acquaintance with Christians except those of the old
sects of the Jacobites and Nestorians. Mutually pleased with our
conversation, we parted from each other with regret.
In the afternoon I was agreeably surprised by the arrival of the
Tinýlkum Ibrahim, for the purpose of supplying his brother’s house
with what was wanted; and being determined to make only one
day’s stay in the town, he had learned with pleasure that we were
about to return by way of Áfasás, the village whither he himself was
going. I myself had cherished this hope, as all the people had
represented that place as one of the largest in the country, and as
pleasantly situated. Hámma had promised to take me this way on
our return to Tin-téllust; but having stayed so much longer in the
town than he had intended, and being afraid of arriving too late for
the salt-caravan of the Kél-owí on their way to Bilma, which he was
to supply with provisions, he changed his plan, and determined to
return by the shortest road. Meanwhile he informed me that the old
chief would certainly not go with us to Zínder till the salt-caravan
had returned from Bilma.
Fortunately, in the course of the 29th a small caravan with corn
arrived from Damerghú, and Hámma completed his purchases. He
had, however, first to settle a disagreeable affair; for our friend
Zúmmuzuk had bought, in Hámma’s name, several things for which
payment was now demanded. Hámma flew into a terrible rage, and
nearly finished the rogue. My Arab and Tawáti friends, who heard
that we were to start the following day, though they were rather
busy buying corn, came to take leave of me, and I was glad to part
from all of them in friendship. But before bidding farewell to this
interesting place, I shall make a few general observations on its
history.
CHAPTER XVIII.
HISTORY OF ÁGADES
At present I still think that I was not far wrong in estimating the
number of the inhabited houses at from six hundred to seven
hundred, and the population at about seven thousand, though it
must be borne in mind that, as the inhabitants have still preserved
their trading character, a great many of the male inhabitants are
always absent from home, a circumstance which reduces the armed
force of the place to about six hundred. A numerical element,
capable of controlling the estimated amount of the population, is
offered by the number of from two hundred and fifty to three
hundred well-bred boys, who at the time of my visit were learning a
little reading and writing, in five or six schools scattered over the
town; for it is not every boy who is sent to school, but only those
belonging to families in easy circumstances, and they are all about
the same age, from eight to ten years old.
With regard to the names of the quarters of the town, which are
interesting from an historical point of view, I was not able to learn
exactly the application of each of the names; and I am sure very few
even of the inhabitants themselves can now tell the limits of the
quarters, on account of the desolate state of many of them. The
principal names which can be laid down with certainty in the plan
are Masráta, Gobetáren, Gáwa-Ngírsu, Dígi or Dégi, Katánga,
Terjemán, and Arrafía, which comprise the south-western quarter of
the town. The names of the other quarters, which I attempted to lay
down on the plan sent to Government together with my report, I
now deem it prudent to withdraw, as I afterwards found that there
was some uncertainty about them. I therefore collect here, for the
information of future travellers, the names of the other quarters of
the place, besides those mentioned above and marked in the plan—
Lárelóg, Churúd, Hásena, Amaréwuël, Imurdán (which name, I was
assured afterwards, has nothing in common with the name of the
tribe of the Imghád), Tafimáta (the quarter where the tribe of the
same name lived), Yobímme (“yobu-mé” meaning the mouth of the
market), Dégi-n-béne, or the Upper Dégi, and Bosenrára. Kachíyu
(not Kachín) seems to have been originally the name of a pool, as I
was assured that, besides the three ponds still visible, there were
formerly seven others, namely Kudúru, Kachíyu, Chikinéwan,
Lángusúgázará, Kurungúsu, and Rabafáda, this latter in the square
of the palace.
The whole ground upon which the town is built (being the edge of
a tableland which coincides with the transition from granite to
sandstone) seems to be greatly impregnated with salt at a certain
depth, of which not only the ponds, but even the wells bear
evidence, two of the three wells still in use having saltish water, and
only that of Shedwánka being, as to taste, free from salt, though it
is still regarded as unwholesome, and all the water used for drinking
is brought from the wells outside the walls. Formerly, it is said, there
were nine wells inside the town.
From what I have said above, it may be concluded that the
commerce of Ágades is now inconsiderable. Its characteristic feature
is that no kind of money whatever is current in the market—neither
gold, nor silver, nor kurdí, nor shells; while strips of cotton, or
gábagá (the Kanúri, and not the Háusa term being employed in this
case, because the small quantity of this stuff which is current is
imported from the north-western province of Bórnu), are very rare,
and indeed form almost as merely nominal a standard as the
mithkál. Nevertheless the value of the mithkál is divided into ten
rijáls, or érjel, which measure means eight drʿa, or cubits, of
gábagá. The real standard of the market, I must repeat, is millet or
dukhn (“géro” in Háusa, “éneli” in Temáshight, Pennisetum
typhoïdeum), durra, or Holcus sorghum, being scarcely ever brought
to market. And it is very remarkable, that with this article a man may
buy everything at a much cheaper rate than with merchandise,
which in general fetches a low price in the place; at least it did so
during my stay, when the market had been well stocked with
everything in demand, by the people who had come along with us.
English calico of very good quality was sold by me at 20 per cent.
less than it had been bought for at Múrzuk. Senna in former times
formed an article of export of some importance; but the price which
it fetches on the coast has so decreased that it scarcely pays the
carriage, the distance from the coast being so very great; and it
scarcely formed at all an article in request here, nor did we meet on
our whole journey a single camel laden with it, though it grows in
considerable quantities in the valleys hereabouts.
Ágades is in no respect a place of resort for wealthy merchants,
not even Arabs, while with regard to Europe its importance at
present consists in its lying on the most direct road to Sókoto and
that part of Sudán. In my opinion it would form for a European
agent a very good and comparatively healthy place from which to
open relations with Central Africa. The native merchants seem only
to visit the markets of Kátsena, Tasáwa, Marádi, Kanó, and Sókoto,
and, as far as I was able to learn, never go to the northern markets
of Ghát or Múrzuk, unless on a journey to Mekka, which several of
them have made. Neither does there seem to exist any intercourse
at present with Gágho, or Gógo, or with Timbúktu; but the Arabs of
Azawád and those parts, when undertaking a pilgrimage, generally
go by way of Ágades.
I must here add, that I did not observe that the people of Ágades
use manna in their food, nor that it is collected in the neighbourhood
of the town; but I did not inquire about it on the spot, not having
taken notice of the passage of Leo relating to it.
My stay in Ágades was too short to justify my entering into detail
about the private life of the people, but all that I saw convinced me
that, although open to most serious censure on the part of the
moralist, it presented many striking features of cheerfulness and
happiness, and nothing like the misery which is often met with in
towns which have declined from their former glory. It still contains
many active germs of national life, which are most gratifying to the
philosophic traveller. The situation, on an elevated plateau, cannot
but be healthy, as the few waterpools, of small dimensions, are
incapable of infecting the air. The disease which I have mentioned in
my diary as prevalent at the time of my sojourn was epidemic.
Besides, it must be borne in mind that the end of the rainy season
everywhere in the tropical regions is the most unhealthy period of
the year.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookmass.com