Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/papers/concurrency/mail2

    r04b4a71 r9fb8f01  
    512512Software: Practice and Experience Editorial Office
    513513
    514 
    515 
    516 Date: Sat, 18 Apr 2020 10:42:13 +0000
    517 From: Richard Jones <onbehalfof@manuscriptcentral.com>
    518 Reply-To: R.E.Jones@kent.ac.uk
    519 To: tdelisle@uwaterloo.ca, pabuhr@uwaterloo.ca
    520 Subject: Software: Practice and Experience - Decision on Manuscript ID
    521  SPE-19-0219.R1
    522 
    523 18-Apr-2020
    524 
    525 Dear Dr Buhr,
    526 
    527 Many thanks for submitting SPE-19-0219.R1 entitled "Advanced Control-flow and Concurrency in Cforall" to Software: Practice and Experience. The paper has now been reviewed and the comments of the referees are included at the bottom of this letter.
    528 
    529 I believe that we are making progress here towards a paper that can be published in Software: Practice and Experience.  However the referees still have significant concerns about the paper. The journal's focus is on practice and experience, and one of the the reviewers' concerns remains that your submission should focus the narrative more on the perspective of the programmer than the language designer. I agree that this would strengthen your submission, and I ask you to address this as well as the referees' other comments.
    530 
    531 A revised version of your manuscript that takes into account the comments of the referee(s) will be reconsidered for publication.
    532 
    533 Please note that submitting a revision of your manuscript does not guarantee eventual acceptance, and that your revision may be subject to re-review by the referees before a decision is rendered.
    534 
    535 You have 90 days from the date of this email to submit your revision. If you are unable to complete the revision within this time, please contact me to request a short extension.
    536 
    537 You can upload your revised manuscript and submit it through your Author Center. Log into https://mc.manuscriptcentral.com/spe  and enter your Author Center, where you will find your manuscript title listed under "Manuscripts with Decisions".
    538 
    539 When submitting your revised manuscript, you will be able to respond to the comments made by the referee(s) in the space provided.  You can use this space to document any changes you make to the original manuscript.
    540 
    541 If you would like help with English language editing, or other article preparation support, Wiley Editing Services offers expert help with English Language Editing, as well as translation, manuscript formatting, and figure formatting at www.wileyauthors.com/eeo/preparation. You can also check out our resources for Preparing Your Article for general guidance about writing and preparing your manuscript at www.wileyauthors.com/eeo/prepresources.
    542 
    543 Once again, thank you for submitting your manuscript to Software: Practice and Experience and I look forward to receiving your revision.
    544 
    545 Sincerely,
    546 Richard
    547 
    548 Prof. Richard Jones
    549 Software: Practice and Experience
    550 R.E.Jones@kent.ac.uk
    551 
    552 
    553 Referee(s)' Comments to Author:
    554 
    555 Reviewing: 1
    556 
    557 Comments to the Author
    558 (A relatively short second review)
    559 
    560 I thank the authors for their revisions and comprehensive response to
    561 reviewers' comments --- many of my comments have been successfully
    562 addressed by the revisions.  Here I'll structure my comments around
    563 the main salient points in that response which I consider would
    564 benefit from further explanation.
    565 
    566 >  Table 1 is moved to the start and explained in detail.
    567 
    568 I consider this change makes a significant improvement to the paper,
    569 laying out the landscape of language features at the start, and thus
    570 addresses my main concerns about the paper.
    571 
    572 I still have a couple of issues --- perhaps the largest is that it's
    573 still not clear at this point in the paper what some of these options
    574 are, or crucially how they would be used. I don't know if it's
    575 possbile to give high-level examples or use cases to be clear about
    576 these up front - or if that would duplicate too much information from
    577 later in the paper - either way expanding out the discussion - even if
    578 just two a couple of sentences for each row - would help me more.  The
    579 point is not just to define these categories but to ensure the
    580 readers' understanding of these definitons agrees with that used in
    581 the paper.
    582 
    583 in a little more detail:
    584 
    585  * 1st para section 2 begs the question: why not support each
    586    dimension independently, and let the programmer or library designer
    587    combiine features?
    588 
    589  * "execution state" seems a relatively low-level description here.
    590   I don't think of e.g. the lambda calculus that way. Perhaps it's as
    591   good a term as any.
    592 
    593  * Why must there "be language mechanisms to create, block/unblock,
    594    and join with a thread"?  There aren't in Smalltalk (although there
    595    are in the runtime).  Especially given in Cforall those mechanisms
    596    are *implicit* on thread creation and destruction?
    597 
    598  * "Case 1 is a function that borrows storage for its state (stack
    599    frame/activation) and a thread from its invoker"
    600 
    601    this much makes perfect sense to me, but I don't understand how a
    602    non-stateful, non-theaded function can then retain
    603 
    604    "this state across callees, ie, function local-variables are
    605    retained on the stack across calls."
    606 
    607    how can it retain function-local values *across calls* when it
    608    doesn't have any functional-local state?
    609 
    610    I'm not sure if I see two separate cases here - rougly equivalent
    611    to C functions without static storage, and then C functions *with*
    612    static storage. I assumed that was the distinction between cases 1
    613    & 3; but perhpas the actual distinction is that 3 has a
    614    suspend/resume point, and so the "state" in figure 1 is this
    615    component of execution state (viz figs 1 & 2), not the state
    616    representing the cross-call variables?
    617 
    618 >    but such evaluation isn't appropriate for garbage-collected or JITTed
    619    languages like Java or Go.
    620 
    621 For JITTed languages in particular, reporting peak performance needs
    622 to "warm up" the JIT with a number of iterators before beginning
    623 measurement. Actually for JIT's its even worse: see Edd Barrett et al
    624 OOPSLA 2017.
    625    
    626 
    627 
    628 minor issues:
    629 
    630  * footnote A - I've looked at various other papers & the website to
    631    try to understand how "object-oriented" Cforall is - I'm still not
    632    sure.  This footnote says Cforall has "virtuals" - presumably
    633    virtual functions, i.e. dynamic dispatch - and inheritance: that
    634    really is OO as far as I (and most OO people) are concerned.  For
    635    example Haskell doesn't have inheritance, so it's not OO; while
    636    CLOS (the Common Lisp *Object* System) or things like Cecil and
    637    Dylan are considered OO even though they have "multiple function
    638    parameters as receivers", lack "lexical binding between a structure
    639    and set of functions", and don't have explicit receiver invocation
    640    syntax.  Python has receiver syntax, but unlike Java or Smalltalk
    641    or C++, method declarations still need to have an explicit "self"
    642    receiver parameter.  Seems to me that Go, for example, is
    643    more-or-less OO with interfaces, methods, and dynamic dispatch (yes
    644    also and an explicit receiver syntax but that's not
    645    determiniative); while Rust lacks dynamic dispatch built-in.  C is
    646    not OO as a language, but as you say given it supports function
    647    pointers with structures, it does support an OO programm style.
    648  
    649    This is why I again recommend just not buying into this fight: not
    650    making any claims about whether Cforall is OO or is not - because
    651    as I see it, the rest of the paper doesn't depend on whether
    652    Cforall is OO or not.  That said: this is just a recommendation,
    653    and I won't quibble over this any further.
    654 
    655  * is a "monitor function" the same as a "mutex function"?
    656    if so the paper should pick one term; if not, make the distinction clear.
    657 
    658 
    659  * "As stated on line 1 because state declarations from the generator
    660     type can be moved out of the coroutine type into the coroutine main"
    661 
    662     OK sure, but again: *why* would a programmer want to do that?
    663     (Other than, I guess, to show the difference between coroutines &
    664     generators?)  Perhaps another way to put this is that the first
    665     para of 3.2 gives the disadvantages of coroutines vs-a-vs
    666     generators, briefly describes the extended semantics, but never
    667     actualy says why a programmer may want those extended semantics,
    668     or how they would benefit.  I don't mean to belabour the point,
    669     but (generalist?) readers like me would generally benefit from
    670     those kinds of discussions about each feature throughout the
    671     paper: why might a programmer want to use them?
    672    
    673 
    674 > p17 if the multiple-monitor entry procedure really is novel, write a paper
    675 > about that, and only about that.
    676 
    677 > We do not believe this is a practical suggestion.
    678 
    679  * I'm honestly not trying to be snide here: I'm not an expert on
    680    monitor or concurrent implementations. Brinch Hansen's original
    681    monitors were single acquire; this draft does not cite any other
    682    previous work that I could see. I'm not suggesting that the brief
    683    mention of this mechanism necessarily be removed from this paper,
    684    but if this is novel (and a clear advance over a classical OO
    685    monitor a-la Java which only acquires the distinguished reciever)
    686    then that would be worth another paper in itself.
    687  
    688 > * conclusion should conclude the paper, not the related.
    689 > We do not understand this comment.if ithis
    690 
    691 My typo: the paper's conclusion should come at the end, after the
    692 future work section.
    693 
    694 
    695 
    696 
    697 To encourage accountability, I'm signing my reviews in 2020.
    698 For the record, I am James Noble, kjx@ecs.vuw.ac.nz.
    699 
    700 
    701 Reviewing: 2
    702 
    703 Comments to the Author
    704 I thank the authors for their detailed response. To respond to a couple of points raised  in response to my review (number 2):
    705 
    706 - on the Boehm paper and whether code is "all sequential to the compiler": I now understand the authors' position better and suspect we are in violent agreement, except for whether it's appropriate to use the rather breezy phrase "all sequential to the compiler". It would be straightforward to clarify that code not using the atomics features is optimized *as if* it were sequential, i.e. on the assumption of a lack of data races.
    707 
    708 - on the distinction between "mutual exclusion" and "synchronization": the added citation does help, in that it makes a coherent case for the definition the authors prefer. However, the text could usefully clarify that this is a matter of definition not of fact, given especially that in my assessment the authors' preferred definition is not the most common one. (Although the mention of Hoare's apparent use of this definition is one data point, countervailing ones are found in many contemporaneous or later papers, e.g. Habermann's 1972 "Synchronization of Communicating Processes" (CACM 15(3)), Reed & Kanodia's 1979 "Synchronization with eventcounts and sequencers" (CACM (22(2)) and so on.)
    709 
    710 I am glad to see that the authors have taken on board most of the straightforward improvements I suggested.
    711 
    712 However, a recurring problem of unclear writing still remains through many parts of the paper, including much of sections 2, 3 and 6. To highlight a couple of problem patches (by no means exhaustive):
    713 
    714 - section 2 (an expanded version of what was previously section 5.9) lacks examples and is generally obscure and allusory ("the most advanced feature" -- name it! "in triplets" -- there is only one triplet!; what are "execution locations"? "initialize" and "de-initialize" what? "borrowed from the invoker" is a concept in need of explaining or at least a fully explained example -- in what sense does a plain function borrow" its stack frame? "computation only" as opposed to what? in 2.2, in what way is a "request" fundamental to "synchronization"? and the "implicitly" versus "explicitly" point needs stating as elsewhere, with a concrete example e.g. Java built-in mutexes versus java.util.concurrent).
    715 
    716 - section 6: 6.2 omits the most important facts in preference for otherwise inscrutable detail: "identify the kind of parameter" (first say *that there are* kinds of parameter, and what "kinds" means!); "mutex parameters are documentation" is misleading (they are also semantically significant!) and fails to say *what* they mean; the most important thing is surely that 'mutex' is a language feature for performing lock/unlock operations at function entry/exit. So say it! The meanings of examples f3 and f4 remain unclear. Meanwhile in 6.3, "urgent" is not introduced (we are supposed to infer its meaning from Figure 12, but that Figure is incomprehensible to me), and we are told of "external scheduling"'s long history in Ada but not clearly what it actually means; 6.4's description of "waitfor" tells us it is different from an if-else chain but tries to use two *different* inputs to tell us that the behavior is different; tell us an instance where *the same* values of C1 and C2 give different behavior (I even wrote out a truth table and still don't see the semantic difference)
    717 
    718 The authors frequently use bracketed phrases, and sometimes slashes "/", in ways that are confusing and/or detrimental to readability. Page 13 line 2's "forward (backward)" is one particularly egregious example. In general I would recommend the the authors try to limit their use of parentheses and slashes as a means of forcing a clearer wording to emerge. Also, the use of "eg." is often cursory and does not explain the examples given, which are frequently a one- or two-word phrase of unclear referent.
    719 
    720 Considering the revision more broadly, none of the more extensive or creative rewrites I suggested in my previous review have been attempted, nor any equivalent efforts to improve its readability. The hoisting of the former section 5.9 is a good idea, but the newly added material accompanying it (around Table 1) suffers fresh deficiencies in clarity. Overall the paper is longer than before, even though (as my previous review stated), I believe a shorter paper is required in order to serve the likely purpose of publication. (Indeed, the authors' letter implies that a key goal of publication is to build community and gain external users.)
    721 
    722 Given this trajectory, I no longer see a path to an acceptable revision of the present submission. Instead I suggest the authors consider splitting the paper in two: one half about coroutines and stack management, the other about mutexes, monitors and the runtime. (A briefer presentation of the runtime may be helpful in the first paper also, and a brief recap of the generator and coroutine support is obviously needed in the second too.) Both of these new papers would need to be written with a strong emphasis on clarity, paying great care to issues of structure, wording, choices of example, and restraint (saying what's important, not everything that could be said). I am confident the authors could benefit from getting early feedback from others at their institution. For the performance experiments, of course these do not split evenly -- most (but not all) belong in the second of these two hypothetical papers. But the first of them would still have plenty of meat to it; for me, a clear and thorough study of the design space around coroutines is the most interesting and tantalizing prospect.
    723 
    724 I do not buy the authors' defense of the limited practical experience or "non-micro" benchmarking presented. Yes, gaining external users is hard and I am sympathetic on that point. But building something at least *somewhat* substantial with your own system should be within reach, and without it the "practice and experience" aspects of the work have not been explored. Clearly C\/ is the product of a lot of work over an extended period, so it is a surprise that no such experience is readily available for inclusion.
    725 
    726 Some smaller points:
    727 
    728 It does not seem right to state that a stack is essential to Von Neumann architectures -- since the earliest Von Neumann machines (and indeed early Fortran) did not use one.
    729 
    730 To elaborate on something another reviewer commented on: it is a surprise to find a "Future work" section *after* the "Conclusion" section. A "Conclusions and future work" section often works well.
    731 
    732 
    733 Reviewing: 3
    734 
    735 Comments to the Author
    736 This is the second round of reviewing.
    737 
    738 As in the first review, I found that the paper (and Cforall) contains
    739 a lot of really interesting ideas, but it remains really difficult to
    740 have a good sense of which idea I should use and when. This applies in
    741 different ways to different features from the language:
    742 
    743 * coroutines/generators/threads: here there is
    744   some discussion, but it can be improved.
    745 * interal/external scheduling: I didn't find any direct comparison
    746   between these features, except by way of example.
    747 
    748 I requested similar things in my previous review and I see that
    749 content was added in response to those requests. Unfortunately, I'm
    750 not sure that I can say it improved the paper's overall read. I think
    751 in some sense the additions were "too much" -- I would have preferred
    752 something more like a table or a few paragraphs highlighting the key
    753 reasons one would pick one construct or the other.
    754 
    755 In general, I do wonder if the paper is just trying to do too much.
    756 The discussion of clusters and pre-emption in particular feels quite
    757 rushed.
    758 
    759 ## Summary
    760 
    761 I make a number of suggestions below but the two most important
    762 I think are:
    763 
    764 * Recommend to shorten the comparison on coroutine/generator/threads
    765   in Section 2 to a paragraph with a few examples, or possibly a table
    766   explaining the trade-offs between the constructs
    767 * Recommend to clarify the relationship between internal/external
    768   scheduling -- is one more general but more error-prone or low-level?
    769 
    770 ## Coroutines/generators/threads
    771 
    772 There is obviously a lot of overlap between these features, and in
    773 particular between coroutines and generators. As noted in the previous
    774 review, many languages have chosen to offer *only* generators, and to
    775 build coroutines by stacks of generators invoking one another.
    776 
    777 I believe the newly introduced Section 2 of the paper is trying to
    778 motivate why each of these constructs exist, but I did not find it
    779 effective. It was dense and difficult to understand. I think the
    780 problem is that Section 2 seems to be trying to derive "from first
    781 principles" why each construct exists, but I think that a more "top
    782 down" approach would be easier to understand.
    783 
    784 In fact, the end of Section 2.1 (on page 5) contains a particular
    785 paragraph that embodies this "top down" approach. It starts,
    786 "programmers can now answer three basic questions", and thus gives
    787 some practical advice for which construct you should use and when. I
    788 think giving some examples of specific applications that this
    789 paragraph, combined with some examples of cases where each construct
    790 was needed, would be a better approach.
    791 
    792 I don't think this compariosn needs to be very long. It seems clear
    793 enough that one would
    794 
    795 * prefer generators for simple computations that yield up many values,
    796 * prefer coroutines for more complex processes that have significant
    797   internal structure,
    798 * prefer threads for cases where parallel execution is desired or
    799   needed.
    800 
    801 I did appreciate the comparison in Section 2.3 between async-await in
    802 JS/Java and generators/coroutines. I agree with its premise that those
    803 mechanisms are a poor replacement for generators (and, indeed, JS has
    804 a distinct generator mechanism, for example, in part for this reason).
    805 I believe I may have asked for this in a previous review, but having
    806 read it, I wonder if it is really necessary, since those mechanisms
    807 are so different in purpose.
    808 
    809 ## Internal vs external scheduling
    810 
    811 I find the motivation for supporting both internal and external
    812 scheduling to be fairly implicit. After several reads through the
    813 section, I came to the conclusion that internal scheduling is more
    814 expressive than external scheduling, but sometimes less convenient or
    815 clear. Is this correct? If not, it'd be useful to clarify where
    816 external scheduling is more expressive.
    817 
    818 The same is true, I think, of the `signal_block` function, which I
    819 have not encountered before; it seems like its behavior can be modeled
    820 with multiple condition variables, but that's clearly more complex.
    821 
    822 One question I had about `signal_block`: what happens if one signals
    823 but no other thread is waiting? Does it block until some other thread
    824 waits? Or is that user error?
    825 
    826 I would find it very interesting to try and capture some of the
    827 properties that make internal vs external scheduling the better
    828 choice.
    829 
    830 For example, it seems to me that external scheduling works well if
    831 there are only a few "key" operations, but that internal scheduling
    832 might be better otherwise, simply because it would be useful to have
    833 the ability to name a signal that can be referenced by many
    834 methods. Consider the bounded buffer from Figure 13: if it had
    835 multiple methods for removing elements, and not just `remove`, then
    836 the `waitfor(remove)` call in `insert` might not be sufficient.
    837 
    838 ## Comparison of external scheduling to messaging
    839 
    840 I did enjoy the section comparing external scheduling to Go's
    841 messaging mechanism, which I believe is a new addition.
    842 
    843 I believe that one difference between the Go program and the Cforall
    844 equivalent is that the Goroutine has an associated queue, so that
    845 multiple messages could be enqueued, whereas the Cforall equivalent is
    846 effectively a "bounded buffer" of length 1. Is that correct? I think
    847 this should be stated explicitly. (Presumably, one could modify the
    848 Cforall program to include an explicit vector of queued messages if
    849 desired, but you would also be reimplementing the channel
    850 abstraction.)
    851 
    852 Also, in Figure 20, I believe that there is a missing `mutex` keyword.
    853 The fiugre states:
    854 
    855 ```
    856 void main(GoRtn & gortn) with(gortn) {
    857 ```
    858 
    859 but I think it should probably be as follows:
    860 
    861 ```
    862 void main(GoRtn & mutex gortn) with(gortn) {
    863 ```
    864 
    865 Unless there is some implicit `mutex` associated with being a main
    866 function for a `monitor thread`.
    867 
    868 ## Atomic operations and race freedom
    869 
    870 I was glad to see that the paper acknowledged that Cforall still had
    871 low-level atomic operations, even if their use is discouraged in favor
    872 of higher-level alternatives.
    873 
    874 However, I still feel that the conclusion overstates the value of the
    875 contribution here when it says that "Cforall high-level race-free
    876 monitors and threads provide the core mechanisms for mutual exclusion
    877 and synchronization, without the need for volatile and atomics". I
    878 feel confident that Java programmers, for example, would be advised to
    879 stick with synchronized methods whenever possible, and it seems to me
    880 that they offer similar advantages -- but they sometimes wind up using
    881 volatiles for performance reasons.
    882 
    883 I was also confused by the term "race-free" in that sentence. In
    884 particular, I don't think that Cforall has any mechanisms for
    885 preventing *data races*, and it clearly doesn't prevent "race
    886 conditions" (which would bar all sorts of useful programs). I suppose
    887 that "race free" here might be referring to the improvements such as
    888 removing barging behavior.
    889 
    890 ## Performance comparisons
    891 
    892 In my previous review, I requested comparisons against Rust and
    893 node.js, and I see that the new version of the paper includes both,
    894 which is a good addition.
    895 
    896 One note on the Rust results: I believe that the results are comparing
    897 against the threads found in Rust's standard library, which are
    898 essentially a shallow wrapper around pthreads, and hence the
    899 performance is quite close to pthread performance (as one would
    900 expect). It would perhaps be more interesting to see a comparison
    901 built using [tokio] or [async-std], two of the more prominent
    902 user-space threading libraries that build on Rust's async-await
    903 feature (which operates quite differently than Javascript's
    904 async-await, in that it doesn't cause every aync function call to
    905 schedule a distinct task).
    906 
    907 [tokio]: https://tokio.rs/
    908 [async-std]: https://async.rs/
    909 
    910 That said, I am satisfied with the performance results as they are in
    911 the current revision.
    912 
    913 ## Minor notes and typos
    914 
    915 Several figures used the `with` keyword. I deduced that `with(foo)`
    916 permits one to write `bar` instead of `foo.bar`. It seems worth
    917 introducing. Apologies if this is stated in the paper, if so I missed
    918 it.
    919 
    920 On page 20, section 6.3, "external scheduling and vice versus" should be
    921 "external scheduling and vice versa".
    922 
    923 On page 5, section 2.3, the paper states "we content" but it should be
    924 "we contend".
    925 
    926 Reviewing: Editor
    927 
    928 A few small comments in addition to those of the referees.
    929 
    930 Page 1. I don't believe that it s fair to imply that Scala is  "research vehicle" as it is used by major players, Twitter being the most prominent example.
    931 
    932 Page 15. Must Cforall threads start after construction (e.g. see your example on page 15, line 21)? I can think of examples where it is not desirable that threads start immediately after construction, e.g. a game with N players, each of whom is expensive to create, but all of whom should be started at the same time.
    933 
    934 Page 18, line 17: is using
    935 
Note: See TracChangeset for help on using the changeset viewer.