Skip to content

Commit 2b876d8

Browse files
committed
changing license
1 parent 8614d48 commit 2b876d8

File tree

7 files changed

+85
-30
lines changed

7 files changed

+85
-30
lines changed

Chapters/Overview.pillar

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ For example, the following snippet is run at the same priority that background u
191191
]]]
192192

193193

194-
The scheduler has process priorities from 1 to 100. Only some of these are named.
194+
The scheduler has process priorities from 10 to 80. Only some of these are named.
195195
The programmer is free to use any priority within that range that they see fit.
196196
The following table lists all the predefined priorities together with their numerical value and purpose.
197197

MaterialForThought/jaromir.txt

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
Dear Stephane,
2+
3+
I’m just reading your Concurrent programming in Pharo; first fo all let me thank you very much for making this available, it’s a great resource!
4+
5+
I’d like to mention two issues to you:
6+
7+
A) I noticed some unintended mistakes:
8+
9+
1. page 8 - 1.7 Process priorities:
10+
“The scheduler has process priorities from 1 to 100” … should be obviously 10 to 80.
11+
(Well, Processor inspect lists quiescentProcessLists from 1 to 80 which is a bit confusing)
12+
13+
2. page 13 - 1.11 Important API:
14+
“ProcessorScheduler yield releases the execution…” … should read “Processor yield releases…” I guess
15+
16+
3. page 31 – Fig. 3-1:
17+
Labels runnable and suspended are swapped.
18+
19+
20+
B) I slightly modified your examples and they don’t work any longer as expected; take e.g. the first in your book:
21+
22+
[ 1 to: 10 do: [ :i |
23+
i trace; trace: ' '.
24+
Processor yield ] ] fork.
25+
26+
[ 101 to: 110 do: [ :i |
27+
i trace; trace: ' '.
28+
Processor yield ] ] fork.
29+
30+
It works properly and produces 1 101 2 102 3 103 4 104 5 105 6 106 7 107 8 108 9 109 10 110.
31+
32+
But once you add some time consuming (e.g. 100ms) code like this:
33+
34+
[ 1 to: 10 do: [ :i |
35+
i trace; trace: ' '.
36+
20000 factorial.
37+
Processor yield ] ] fork.
38+
39+
[ 101 to: 110 do: [ :i |
40+
i trace; trace: ' '.
41+
20000 factorial.
42+
Processor yield ] ] fork
43+
44+
it produces a mix like 1 101 102 2 3 103 104 4 105 5 106 107 108 6 109 7 110 8 9 10.
45+
46+
It took me a while but then I realized it’s because of the default
47+
Smalltalk vm processPreemptionYields: true
48+
Once you change it to false it starts behaving as expected. The thing is any higher priority process preempts the first process but after the higher priority process finishes the other one continues which is in this case unfortunate.
49+
50+
The same happens in this example – it produces e.g. 3 2 3 3 2 2 instead of 3 3 3 2 2 2:
51+
[3 timesRepeat: [3 trace. ' ' trace. 20000 factorial ]] fork.
52+
[3 timesRepeat: [2 trace. ' ' trace. 20000 factorial ]] fork
53+
54+
What bothers me though is that if you run the above example with forkAt: 41 it behaves ok; Can it mean the UI process (at 40) interferes with the processes that run with the same priority (40) – how come?? Or do I miss something?
55+
56+
I used a fresh image Pharo 8.0.0
57+
Build information: Pharo-8.0.0+build.1124.sha.0932da82f08175e906b0e2a8052120c823374e9f (64 Bit)
58+
59+
I’m new to Smalltalk so I hope I haven’t missed some obvious thing :) I appreciate your time and thank you again for making a lot of Smalltalk resources available and especially this one – great explanations and examples.
60+
61+
Best regards,
62+
63+
Jaromir
64+
--
65+
Jaromir Matas

_support/.DS_Store

0 Bytes
Binary file not shown.
-4.51 KB
Binary file not shown.
11.8 KB
Binary file not shown.

_support/templates/.DS_Store

0 Bytes
Binary file not shown.

_support/templates/latex/main.mustache

Lines changed: 19 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -40,41 +40,31 @@
4040
Copyright 2017 by «& attribution».
4141

4242
The contents of this book are protected under the Creative Commons
43-
Attribution-ShareAlike 3.0 Unported license.
44-
45-
You are \textbf{free}:
46-
\begin{itemize}
47-
\item to \textbf{Share}: to copy, distribute and transmit the work,
48-
\item to \textbf{Remix}: to adapt the work,
49-
\end{itemize}
50-
43+
Attribution-NonCommercial-NoDerivs
44+
CC BY-NC-ND
45+
You are free to:
46+
\begin{description}
47+
\item Share --- copy and redistribute the material in any medium or format
48+
\end{description}
49+
50+
The licensor cannot revoke these freedoms as long as you follow the license terms.
5151
Under the following conditions:
5252
\begin{description}
53-
\item[Attribution.] You must attribute the work in the manner specified by the
54-
author or licensor (but not in any way that suggests that they endorse you
55-
or your use of the work).
56-
\item[Share Alike.] If you alter, transform, or build upon this work, you may
57-
distribute the resulting work only under the same, similar or a compatible
58-
license.
53+
\item[Attribution.] --- You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
54+
\item[NonCommercial.] --- You may not use the material for commercial purposes.
55+
\item [NoDerivatives.] --- If you remix, transform, or build upon the material, you may not distribute the modified material.
56+
\item [No additional restrictions.] --- You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
5957
\end{description}
6058

61-
For any reuse or distribution, you must make clear to others the
62-
license terms of this work. The best way to do this is with a link to
63-
this web page: \\
64-
\url{http://creativecommons.org/licenses/by-sa/3.0/}
65-
66-
Any of the above conditions can be waived if you get permission from
67-
the copyright holder. Nothing in this license impairs or restricts the
68-
author's moral rights.
59+
\url{https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode}
6960

70-
\begin{center}
71-
\includegraphics[width=0.2\textwidth]{_support/latex/sbabook/CreativeCommons-BY-SA.pdf}
72-
\end{center}
61+
Any of the above conditions can be waived if you get permission from
62+
the copyright holder. Nothing in this license impairs or restricts the
63+
author's moral rights.
7364

74-
Your fair dealing and other rights are in no way affected by the
75-
above. This is a human-readable summary of the Legal Code (the full
76-
license): \\
77-
\url{http://creativecommons.org/licenses/by-sa/3.0/legalcode}
65+
\begin{center}
66+
\includegraphics[width=0.2\textwidth]{_support/latex/sbabook/CreativeCommons-BYNOCND.pdf}
67+
\end{center}
7868

7969
\vfill
8070

0 commit comments

Comments
 (0)