Download Complete Nonsequential and Distributed Programming with Go. Christian Maurer PDF for All Chapters
Download Complete Nonsequential and Distributed Programming with Go. Christian Maurer PDF for All Chapters
com
https://ebookmeta.com/product/nonsequential-and-distributed-
programming-with-go-christian-maurer/
OR CLICK BUTTON
DOWNLOAD NOW
Nonsequential
and Distributed
Programming
with Go
Synchronization of Concurrent Processes:
Communication
Cooperation
Competition
Nonsequential and Distributed Programming
with Go
Christian Maurer
Nonsequential and
Distributed Programming
with Go
Synchronization of Concurrent Processes:
Communication—Cooperation—
Competition
Christian Maurer
Institut für Informatik
Freie Universität Berlin
Berlin, Germany
“Nonsequential Programming”
“Concurrent Programming”.
• nebenläufig and
• nichtsequentiell.
The first word is the exact translation of “concurrent”1 , the second is simply the
negation of sequentiell, i.e. “nichtsequentiell” is just “not sequentiell”.
So, strictly speaking, “concurrent programming” means, that several developers are
working together to write a program, but makes no sense for a book title; whereas “non-
sequential programming” means the development of nonsequential programs, which is
our topic. Processes with access to shared resources may run concurrently on one or
more computers; algorithms, however, cannot be concurrent—they are either sequential
or not. This is probably the reason, why in all German universities lectures on this topic
are named “Nichtsequentielle Programmierung”.
This is why we prefer to use the German word for “nonsequential” in the context of
“programs” and “programming”, as in our opinion that adjective is much better suited
for this purpose, and stick to the German term in so far, as we use the spelling “nonse-
quential” instead of “non-sequential”. Furthermore,
1Latin: concurrere = cum + currere; cum = (together) with, currere = run, go, walk
vii
viii Preface
• locks,
• semaphores,
• fairness and deadlocks,
• monitors,
• message passing,
• network-wide message passing.
• exploration of networks,
• traversal in networks and
• selection of a leader in them.
More information can be found in the net at the beginning of the Frequently Asked
Questions by Go (https://golang.org/doc/faq).
To run the programs from the book, the installation of Go version 1.9 (or higher) is
assumed.
Basic knowledge of Go is certainly helpful for understanding the basic concepts, but
not necessary because of the simple syntax.
However, familiarizing yourself with Go is significantly (!) easier than, for example,
acquiring the knowledge in Java required to understand algorithms in comparable depth.
If you don't want to do this, you can understand the Go source texts “meta-linguisti-
cally”—such as the language-independent representations of algorithms in the textbooks
of Andrews, Ben-Ari, Herrtwich/Hommel, Raynal or Taubenfeld .
At “switching points”—locks, semaphores, monitors and network-wide message pass-
ing—some basic approaches to programming in C and Java are also presented.
Knowledge of imperative representations of abstract data objects, of the principles of
“information-hiding” and the basic concepts of object-oriented programming are how-
ever required; some important information—as far as it is needed for this book—can be
found in Chap. 2 about packages, interfaces and abstract data types.
The content structure is inductive:
The growing distance from the machine is associated with increasing abstraction,
which corresponds very naturally to the historical development of NSP: locks—sema-
phores—monitors—message passing. This structure can already be described as tradi-
tional, as it can also be found in most other textbooks.
Reading is therefore essentially only meaningful sequentially, i.e. in the order of the
chapters.
Focusing on Go would have offered an alternative order of the contents, starting with
the highest level of abstraction, the passing of messages via channels—a core concept
of this language—which is particularly recommended by its developers as the means
of choice for synchronization (see Sect. 1.9 on process states in the introduction and
Chap. 11 about messages). This path is deliberately not followed here, however, in order
to be able to use the book in environments in which other languages are favoured.
A fundamental principle of the book consists in the fact that the same classic exam-
ples are taken up again and again, which facilitates the comparison between the pre-
sented concepts and language tools.
The readers are strongly recommended,
• to work through these examples carefully in order to gain deeper insight into the simi-
larities and differences between the concepts,
• to perceive the suggestions for their own activities, i.e. to take up as many suggestions
for exercises as possible,
• to go ad fontes (original papers are fundamental sources, because they provide deeper
insights into the systematics of the development of NSP),
x Preface
Compared to the third edition, some bugs have been fixed and minor enhancements
added.
The essential difference to the 3rd edition, however, is that—due to a change in the
Go system—adjustments were required: The previous basic assumption that a value
assignment of a constant or variable to a variable of an elementary type is atomic is
now only valid in Go if the computer used has only one processor or if runtime.
GOMAXPROCS(1) was called.
Therefore, the value assignments to shared variables used in the entry and exit proto-
cols to protect critical sections now principally need to be replaced by an atomic instruc-
tion—realized with an indivisible machine instruction.
For some of the algorithms given in the book test runs can be carried out in which
their sequence is visualized dynamically. The corresponding program files, some of
which use C-library-routines and header files in /usr/include, are included in the source
texts of this book.
I would like to thank Mrs. Dipl.-Inf. Sybille Thelen from Springer-Verlag very much;
she also supported the publication of this edition very kindly again.
In June 2018 she informed me, that Springer Nature had selected my book among
some others to create in cooperation with DeepL an English version. I was very happy
about that idea and immediately agreed. In the middle of December 2019 I got the
result, but I after having read the first pages of it was a bit disappointed on quite a lot
of mistakes in the computer aided translation. The were some really funny ones as, e.g.,
“castle” and “lure” for lock, “trial” and “lawsuit” for process, “net curtain” for “store”,
“voltage tree” and “current beam” for spanning tree, “beacon” for signal, “embassy” for
message and “episode” for sequence and, furthermore, lots of things like the remarkable
statement “Any deterministic algorithm is deterministic, but not any deterministic algo-
rithm is necessary deterministic.” But there were also several of really annoying errors
such as grammar mistakes, rather strange orders of words in sentences and many wrong
translations that completely distorted contents. However, this experience implies, that I
will never sit in an AI-controlled car.
I have to thank the book production teams of Springer Nature, Heidelberg, and of
Scientific Publishing Services Ltd., Chennai: They have improved my corrections of the
DeepL-translation. I would also like to thank Mrs. Ivonne Eling for organizing things in
the background and Mr. Stefan Schmidt for several suggestions.
Finally, an important hint: Despite constant and thorough comparison of all source
texts reproduced in the book in the course of their development, it cannot be ruled out
with absolute certainty, that there are inconsistencies somewhere. (Hints to discovered
discrepancies or errors are of course very gratefully accepted!)
Preface xi
All source texts are is available on the pages of the book in the worldwide web:
https://maurer-berlin.eu/nspbook/4.
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 Definition of Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Motivation and Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3 The (Non-)Sense of Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.4 Examples of Concurrent Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.5 Concurrency and the Informal Notion of a Process . . . . . . . . . . . . . . . 11
1.6 Conflicts When Addressing Shared Data . . . . . . . . . . . . . . . . . . . . . . . 14
1.7 Atomic Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.8 Critical Sections and Lock Synchronization . . . . . . . . . . . . . . . . . . . . . 20
1.9 Process States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
1.9.1 Process Transitions in C, Java, and Go . . . . . . . . . . . . . . . . 23
1.9.2 Example in C, Java, and Go . . . . . . . . . . . . . . . . . . . . . . . . 30
References. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2 Packages, Interfaces, and Abstract Data Types . . . . . . . . . . . . . . . . . . . . . . . 33
2.1 The Role of Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.1.1 Packages Only as Interfaces . . . . . . . . . . . . . . . . . . . . . . . . 35
2.2 All Source Codes from This Book in the nUniverse Package . . . . . . . 36
2.3 The Package Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.3.1 Any . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.3.2 Interfaces for Describing Objects . . . . . . . . . . . . . . . . . . . . 37
2.3.3 The Interface of the Package . . . . . . . . . . . . . . . . . . . . . . . . 40
2.3.4 Queues as Abstract Data Type . . . . . . . . . . . . . . . . . . . . . . . 41
2.3.5 A Queue as an Abstract Data Object . . . . . . . . . . . . . . . . . . 44
2.3.6 Bounded Buffers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
2.4 On the Problem of References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
References. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
3 Locks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
3.1 Specification of Locks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
3.2 Locks in C, Java, and Go . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
xiii
xiv Contents
3.2.1 Locks in C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
3.2.2 Locks in Java . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
3.2.3 Locks in Go . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
3.3 Locks Based on Indivisible Machine Instructions . . . . . . . . . . . . . . . . 53
3.3.1 Test and Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
3.3.2 Compare and Swap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
3.3.3 Exchange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
3.3.4 Decrement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
3.3.5 Fetch and Increment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
3.3.6 The Counter Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
3.3.7 Evaluation of the Use of Machine Instructions . . . . . . . . . . 61
3.4 Lock Algorithms for 2 Processes at High-Level Language Level . . . . 63
3.4.1 On the Indivisibility of Value Assignments . . . . . . . . . . . . . 63
3.4.2 Approaches to the Development of a Correct Algorithm . . . 64
3.4.3 Algorithm of Peterson . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
3.4.4 Algorithm of Kessels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
3.4.5 Algorithm of Dekker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
3.4.6 Algorithm of Doran and Thomas . . . . . . . . . . . . . . . . . . . . 72
3.4.7 Algorithm of Hyman . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
3.5 Lock Algorithms for Several Processes . . . . . . . . . . . . . . . . . . . . . . . . 73
3.5.1 Tiebreaker Algorithm of Peterson . . . . . . . . . . . . . . . . . . . . 75
3.5.2 Algorithm of Dijkstra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
3.5.3 Algorithm of Knuth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
3.5.4 Algorithm of Eisenberg and McGuire . . . . . . . . . . . . . . . . 80
3.5.5 Algorithm of Habermann . . . . . . . . . . . . . . . . . . . . . . . . . . 81
3.5.6 Ticket Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
3.5.7 Bakery Algorithm of Lamport . . . . . . . . . . . . . . . . . . . . . . . 83
3.5.8 Algorithm of Kessels for N Processes . . . . . . . . . . . . . . . . 85
3.5.9 Algorithm of Morris . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
3.5.10 Algorithm of Szymanski . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
3.6 Locks as Abstract Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
References. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
4 Semaphores . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
4.1 Disadvantages of the Implementation of Locks . . . . . . . . . . . . . . . . . . 97
4.2 Dijkstra’s Approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
4.3 Binary Semaphores . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
4.3.1 Equivalence of Locks and Binary Semaphores . . . . . . . . . . 100
4.3.2 Algorithm of Udding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
4.4 Buffers in the Nonsequential Case . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Contents xv
The imagination has touched that word “alien,” and in it we see the
field through Ruth’s eyes, as she looked round on the hostile spikes,
and not through those of the poet.
Imagination plus the poetic sense is poesy, minus the poetic sense it
is science, though it may clothe itself in verse. To those who are
familiar with Dr. Donne’s verses, I need only mention his name as a
proof of my last position. He solves problems in rhyme, that is all.
As regards man, Fancy takes delight in life, manners, and the result
of culture, in what may be called Scenery; Imagination is that
mysterious something which we call Nature—the unfathomed base
on which Scenery rests and is sustained. Fancy deals with feeling;
Imagination with passion. I have sometimes thought that
Shakspeare, in the scene of the “Tempest,” intended to typify the isle
of Man, and in the characters, some of the leading qualities or
passions which dwell in it. It is not hard to find the Imagination in
Prospero, the Fancy in Ariel, and the Understanding in Caliban; and,
as he himself was the poetic imagination incarnated, is it considering
too nicely to think that there is a profound personal allusion in the
breaking of Prospero’s wand and the burying of his book to the
nature of that man who, after such thaumaturgy, could go down to
Stratford and live there for years, only collecting his dividends from
the Globe Theatre, lending money on mortgage, and leaning over
the gate to chat and chaffer with his neighbors?
I think that every man is conscious at times that it is only his borders,
his seaboard, that is civilized and subdued. Behind that narrow strip
stretches the untamed domain, shaggy, unexplored, of the natural
instincts. Is not this so? Then we can narrow our definition yet
farther, and say that Fancy and Wit appear to the artificial man;
Imagination and Humor to the natural man. Thus each of us in his
dual capacity can at once like Chaucer and Pope, Butler and Jean
Paul, and bury the hatchet of one war of tastes.
And now, finally, what is the secret of the great poet’s power over
us? There is something we love better than love, something that is
sweeter to us than riches, something that is more inspiring to us than
success—and that is the imagination of them. No woman was ever
loved enough, no miser was ever rich enough, no ambitious man
ever successful enough, but in imagination. Every desire of the heart
finds its gratification in the poet because he speaks always
imaginatively and satisfies ideal hungers. We are the always-
welcome guests of his ennobling words.
This, then, is why the poet has always been held in reverence
among men. All nature is dumb, and we men have mostly but a
stunted and stuttering speech. But the longing of every created thing
is for utterance and expression. The Poet’s office, whether we call
him Seer, Prophet, Maker, or Namer, is always this—to be the Voice
of this lower world. Through him, man and nature find at last a
tongue by which they can utter themselves and speak to each other.
The beauties of the visible world, the trembling attractions of the
invisible, the hopes and desires of the heart, the aspirations of the
soul, the passions and the charities of men; nay, the trees, the rocks,
our poor old speechless mother, the earth herself, become voice and
music, and attain to that humanity, a divine instinct of which is
implanted in them all.
LECTURE II
PIERS PLOUGHMAN’S VISION
II
In literature, as in religion and politics, there is a class of men who
may be called Fore-runners. As there were brave men before
Agamemnon, so there must have been brave poets before Homer.
All of us, the great as well as the little, are the result of the entire
Past. It is but just that we should remember now and then that the
very dust in the beaten highways of thought is that of perhaps
nameless saints and heroes who thought and suffered and died to
make commonplace practicable to us. Men went to the scaffold or
the stake for ideas and principles which we set up in our writings and
our talk as thoughtlessly as a printer sticks his type, and the country
editor, when he wrote his last diatribe on the freedom of the press,
dipped his pen without knowing it in the blood of the martyrs. It would
be well for us to remember, now and then, our dusty benefactors,
and to be conscious that we are under bonds to the Present to the
precise amount that we are indebted to the Past.
Thus, from one point of view, there is nothing more saddening than a
biographical dictionary. It is like a graveyard of might-have-beens
and used-to-be’s, of fames that never ripened and of fames already
decayed. Here lies the great Thinker who stammered and could not
find the best word for his best thought, and so the fame went to
some other who had the gift of tongues. Here lies the gatherer of
great masses of learning from which another was to distil the
essence, and to get his name upon all the phials and show-bills. But
if these neglected headstones preach the vanity of a selfish
ambition, they teach also the better lesson that every man’s activity
belongs not to himself but to his kind, and whether he will or not
must serve at last some other, greater man. We are all foot-soldiers,
and it is out of the blood of a whole army of us that iron enough is
extracted to make the commemorative sword that is voted to the
great Captain.
In that long aqueduct which brings the water of life down to us from
its far sources in the Past, though many have done honest day-labor
in building it, yet the keystone that unites the arch of every period is
engraved with the name of the greatest man alone. These are our
landmarks, and mentally we measure by these rather than by any
scheme of Chronology. If we think of Philosophy, we think of four or
five great names, and so of Poetry, Astronomy, and the rest. Geology
may give what age she will to the globe; it matters not, it will still be
only so many great men old; and wanting these, it is in vain that
Egypt and Assyria show us their long bead-roll of vacant centuries. It
is in the life of its great men that the life and thought of a people
becomes statuesque, rises into poetry, and makes itself sound out
clearly in rhythm and harmony.
These great persons get all the fame and all the monuments like the
generals of armies, though we may lead the forlorn hope, or make a
palpitating bridge with our bodies in the trenches. Rank and file may
grumble a little—but it is always so, and always must be so. Fame
would not be fame if it were or could be divided infinitesimally, and
every man get his drachm and scruple. It is good for nothing unless it
come in a lump. And besides, if every man got a monument or an
epitaph who felt quite sure he deserved it, would marble hold out, or
Latin?
Of the poet we do not ask everything, but the best expression of the
best of everything. If a man attain this but once, though only in a frail
song, he is immortal; while every one who falls just short of it, if only
by a hair’s breadth, is as sure to be forgotten. There is a wonderful
secret that poets have not yet learned, and this is that small men
cannot do great things, but that the small man who can do small
things best is great. The most fatal ill-success is to almost succeed,
as, in Italy, the worst lemons are those large ones which come
nearest to being oranges. The secret of permanent fame is to
express some idea the most compactly, whether in your life, your
deed, or your writing. I think that if anything is clear in history, it is
that every idea, whether in morals, politics, or art, which is laboring
to express itself, feels of many men and throws them aside before it
finds the one in whom it can incarnate itself. The noble idea of the
Papacy (for it was a noble one—nothing less than the attempt to
embody the higher law in a human institution) whispered itself to
many before it got the man it wanted in Gregory the Great. And
Protestantism carried numbers to the stake ere it entered into Luther:
a man whom nature made on purpose—all asbestos so that he could
not burn. Doubtless Apollo spoiled many a reed before he found one
that would do to pipe through even to the sheep of Admetus, and the
land of song is scattered thick with reeds which the Muse has
experimented with and thrown away.
I find no fault with the author of Piers Ploughman for not being a
poet. Every man cannot be a poet (fortunately), nor every poet a
great one. It is the privilege of the great to be always
contemporaneous, to speak of fugacious events in words that shall
be perennial. But to the poets of the second rate we go for pictures
of manners that have passed away, for transitory facts, for modes of
life and ways of thinking that were circumstantial merely. They give
us reflections of our outward, as their larger brethren do of our
inward, selves. They deal, as it were, with costume; the other with
man himself.
But these details are of interest, so fond are we of facts. We all have
seen the congregation which grew sleepy while the preacher talked
of the other world give a stir of pleased attention if he brought in a
personal anecdote about this. Books are written and printed, and we
read them to tell us how our forefathers cocked their hats, or turned
up the points of their shoes; when blacking and starch were
introduced; who among the Anglo-Saxons carried the first umbrella,
and who borrowed it.
Mr. Lowell here read long extracts from the poem, with a
commentary of his own, generally brief, of which we can give only
the following fine passage on Personification.
The truth is, that ideal personifications are commonly little better than
pinchbeck substitutes for imagination. They are a refuge which
unimaginative minds seek from their own sterile imaginativeness.
They stand in the same relation to poetry as wax figures to sculpture.
The more nearly they counterfeit reality, the more unpleasant they
are, and there is always a dejected irresponsibleness about the legs
and a Brattle street air in the boots that is ludicrous. The imagination
gives us no pictures, but the thing itself. It goes out for the moment
to dwell in and inform with its own life the object of its vision—as
Keats says somewhere in one of his letters, “I hop about the gravel
and pick up crumbs in the sparrows.” And so, in personifying, the
imagination must have energy to project its own emotion so as to
see it objectively—just as the disease of the hypochondriac runs
before him in a black dog. Thus it was that the early poets, “who
believed the wonders that they sang,” peopled the forests, floods,
and mountains with real shapes of beauty or terror; and accordingly
in primitive times ecstasy is always attributed to the condition of the
poetic mind. To the great poets these ecstasies are still possible, and
personification had its origin in the tradition of these, and the
endeavor of inferior minds to atone for their own languor by what we
may call historical or reminiscental imagination. Here is indicated the
decline from faith to ritual. Shakspeare has illustrated the true secret
of imaginative personification when he makes the conscience of
Macbeth become external and visible to him in the ghastly shape at
the banquet which he alone can see, and Lady Macbeth’s afterwards
in the blood-stain on her hand. This is the personification of the
creative mind whose thoughts are not images, but things. And this
seems to have been the normal condition of Shakspeare’s genius,
as it is the exceptional one of all other poets. He alone has
embodied in flesh and blood his every thought and fancy and
emotion, his every passion and temptation. Beside him all other
poets seem but the painters and not the makers of men. He sent out
his profound intellect to look at life from every point of view, and
through the eyes of all men and women from the highest to the
lowest. In every one he seems to have tapped it with the knuckles, to
have said sadly, Tinnit, inane est, It rings, it is hollow; and then to
have gone down quietly to wait for death and another world at
Stratford.
After reading more extracts from the poem, Mr. Lowell concluded his
lecture in these words:
Truly it seems to me that I can feel a heart beat all through this old
poem, a manly, trustful, and tender one. There are some men who
have what may be called a vindictive love of Truth—whose love of it,
indeed, seems to be only another form of hatred to their neighbor.
They put crooked pins on the stool of repentance before they invite
the erring to sit down on it. Our brother Langland is plainly not one of
these.
III
Where is the Golden Age? It is fifty years ago to every man and
woman of three-score and ten. I do not doubt that aged Adam
babbled of the superiority of the good old times, and, forgetful in his
enthusiasm of that fatal bite which set the teeth of all his
descendants on edge, told, with a regretful sigh, how much larger
and finer the apples of his youth were than that to which the great-
grandson on his knee was giving a preliminary polish. Meanwhile the
great-grandson sees the good times far in front, a galaxy of golden
pippins whereof he shall pluck and eat as many as he likes without
question. Thus it is that none of us knows when Time is with him, but
the old man sees only his shoulders and that inexorable wallet in
which youth and beauty and strength are borne away as alms for
Oblivion; and the boy beholds but the glowing face and the hands
stretched out full of gifts like those of a St. Nicholas. Thus there is
never any present good; but the juggler, Life, smilingly baffles us all,
making us believe that the vanished ring is under his left hand or his
right, the past or the future, and shows us at last that it was in our
own pocket all the while.
But what form is that which rises before us, with features in which
the gentle and forgiving reproach of the woman is lost in the aspiring
power of the martyr?
that bravest and most loyal heart over whose beatings knightly armor
was ever buckled, that saintly shape in which even battle looks
lovely, that life so pure, so inspired, so humble, which stands there
forever to show us how near womanhood ever is to heroism, and
that the human heart is true to an eternal instinct when it paints Faith
and Hope and Charity and Religion with the countenances of
women.
But those old days, whether good or bad, have left behind them a
great body of literature, of which even yet a large part remains
unprinted. To this literature belong the Metrical Romances.
Astonished by the fancy and invention so abundantly displayed by
the writers of these poems, those who have written upon the subject
have set themselves gravely to work to find out what country they
could have got them from. Mr. Warton, following Dr. Warburton,
inclines to assign them to an Oriental origin. Dr. Percy, on the other
hand, asserts a Scandinavian origin; while Ritson, who would have
found it reason enough to think that the sun rose in the West if
Warton or Percy had taken the other side, is positive that they were
wholly French. Perhaps the truth lies somewhere between the
positions of Percy and Ritson. The Norman race, neither French nor
Scandinavian, was a product of the mingled blood of both, and in its
mental characteristics we find the gaiety and lively fancy of the one
tempering what is wild in the energy and gloomy in the imagination
of the other.
We know the exact date of the arrival of the first Metrical Romance in
England. Taillefer, a Norman minstrel, brought it over in his head,
and rode in the front at the battle of Hastings singing the song of
Roland. Taillefer answers precisely the description of a Danish skald,
but he sang in French, and the hero he celebrated was one of the
peers of Charlemagne, who was himself a German.
With regard to a large part of the romances of the Round Table, and
those which grew out of them, it is tolerably certain that, although
written in French, they were made in England.