What is a good way for message passing concurrency in Java? [closed]











up vote
-1
down vote

favorite












What is a good way for message passing concurrency in Java? By the message passing concurrency in Java, I mean roughly that programmers can write concurrent Java programs using send and receive operations on shared channels.



The motivation for this question came from the design of CML (Concurrent ML) by John Reppy, where message passing concurrency is introduced as the feature of programming language:




  • https://en.wikipedia.org/wiki/Concurrent_ML


I wish to adopt the concurrency features of CML in Java.



A book that I found is 'Concurrency: state models & Java programs' written by Jeff Magee and Jeff Kramer, which describes a method for message passing concurrency in Java in chapter 10. This method is thought to correspond to the part of what CML supports but is available in Java. One can download their Java implementation.



But I wonder if there is any complete support in Java of all the features of CML for message passing concurrency.










share|improve this question















closed as off-topic by Andy Turner, GhostCat, kapex, Jeffrey Chung, David Makogon Nov 19 at 16:13


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – Andy Turner, GhostCat, kapex, Jeffrey Chung

If this question can be reworded to fit the rules in the help center, please edit the question.













  • Questions asking for off-site resources (such books/tutorials, tools/libraries) are off-topic here.
    – GhostCat
    Nov 19 at 13:24










  • Can you, Andy Turner, GhostCat, kapex, Jeffrey Chung, or David Makogan review the revised question?
    – user3509406
    Nov 20 at 10:25










  • Sorry, but I don't think that we can help here. First of all: this is really an interesting question. But I think it doesn't fit the scope of this community. You see, to answer the question, one would have to A) understand exactly what the exact set and nature of these features is. To then, B) one by one look into how Java is doing that. So even though you are no longer (explicitly) asking for a library, your question still isn't a good fit here. At least me, I do not see that re-opening this question is justified. And honestly: implicitly, this still asks for a library.
    – GhostCat
    Nov 20 at 10:44












  • In other words: when you start doing the required research to a certain degree, such as A) listing the exact features you are interested in and then B) do a bit of research on java ... to then finally present a question that reads "CML has this feature, and I think Java has this equivalent (or is missing that)" then we might be able to confirm that, or add more details. But you would better ask one question for one feature, or at least group of related features.
    – GhostCat
    Nov 20 at 10:45






  • 1




    I see. Thanks for your comment.
    – user3509406
    Nov 20 at 11:23















up vote
-1
down vote

favorite












What is a good way for message passing concurrency in Java? By the message passing concurrency in Java, I mean roughly that programmers can write concurrent Java programs using send and receive operations on shared channels.



The motivation for this question came from the design of CML (Concurrent ML) by John Reppy, where message passing concurrency is introduced as the feature of programming language:




  • https://en.wikipedia.org/wiki/Concurrent_ML


I wish to adopt the concurrency features of CML in Java.



A book that I found is 'Concurrency: state models & Java programs' written by Jeff Magee and Jeff Kramer, which describes a method for message passing concurrency in Java in chapter 10. This method is thought to correspond to the part of what CML supports but is available in Java. One can download their Java implementation.



But I wonder if there is any complete support in Java of all the features of CML for message passing concurrency.










share|improve this question















closed as off-topic by Andy Turner, GhostCat, kapex, Jeffrey Chung, David Makogon Nov 19 at 16:13


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – Andy Turner, GhostCat, kapex, Jeffrey Chung

If this question can be reworded to fit the rules in the help center, please edit the question.













  • Questions asking for off-site resources (such books/tutorials, tools/libraries) are off-topic here.
    – GhostCat
    Nov 19 at 13:24










  • Can you, Andy Turner, GhostCat, kapex, Jeffrey Chung, or David Makogan review the revised question?
    – user3509406
    Nov 20 at 10:25










  • Sorry, but I don't think that we can help here. First of all: this is really an interesting question. But I think it doesn't fit the scope of this community. You see, to answer the question, one would have to A) understand exactly what the exact set and nature of these features is. To then, B) one by one look into how Java is doing that. So even though you are no longer (explicitly) asking for a library, your question still isn't a good fit here. At least me, I do not see that re-opening this question is justified. And honestly: implicitly, this still asks for a library.
    – GhostCat
    Nov 20 at 10:44












  • In other words: when you start doing the required research to a certain degree, such as A) listing the exact features you are interested in and then B) do a bit of research on java ... to then finally present a question that reads "CML has this feature, and I think Java has this equivalent (or is missing that)" then we might be able to confirm that, or add more details. But you would better ask one question for one feature, or at least group of related features.
    – GhostCat
    Nov 20 at 10:45






  • 1




    I see. Thanks for your comment.
    – user3509406
    Nov 20 at 11:23













up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











What is a good way for message passing concurrency in Java? By the message passing concurrency in Java, I mean roughly that programmers can write concurrent Java programs using send and receive operations on shared channels.



The motivation for this question came from the design of CML (Concurrent ML) by John Reppy, where message passing concurrency is introduced as the feature of programming language:




  • https://en.wikipedia.org/wiki/Concurrent_ML


I wish to adopt the concurrency features of CML in Java.



A book that I found is 'Concurrency: state models & Java programs' written by Jeff Magee and Jeff Kramer, which describes a method for message passing concurrency in Java in chapter 10. This method is thought to correspond to the part of what CML supports but is available in Java. One can download their Java implementation.



But I wonder if there is any complete support in Java of all the features of CML for message passing concurrency.










share|improve this question















What is a good way for message passing concurrency in Java? By the message passing concurrency in Java, I mean roughly that programmers can write concurrent Java programs using send and receive operations on shared channels.



The motivation for this question came from the design of CML (Concurrent ML) by John Reppy, where message passing concurrency is introduced as the feature of programming language:




  • https://en.wikipedia.org/wiki/Concurrent_ML


I wish to adopt the concurrency features of CML in Java.



A book that I found is 'Concurrency: state models & Java programs' written by Jeff Magee and Jeff Kramer, which describes a method for message passing concurrency in Java in chapter 10. This method is thought to correspond to the part of what CML supports but is available in Java. One can download their Java implementation.



But I wonder if there is any complete support in Java of all the features of CML for message passing concurrency.







java concurrency message-passing






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 20 at 1:23

























asked Nov 19 at 10:35









user3509406

1077




1077




closed as off-topic by Andy Turner, GhostCat, kapex, Jeffrey Chung, David Makogon Nov 19 at 16:13


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – Andy Turner, GhostCat, kapex, Jeffrey Chung

If this question can be reworded to fit the rules in the help center, please edit the question.




closed as off-topic by Andy Turner, GhostCat, kapex, Jeffrey Chung, David Makogon Nov 19 at 16:13


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – Andy Turner, GhostCat, kapex, Jeffrey Chung

If this question can be reworded to fit the rules in the help center, please edit the question.












  • Questions asking for off-site resources (such books/tutorials, tools/libraries) are off-topic here.
    – GhostCat
    Nov 19 at 13:24










  • Can you, Andy Turner, GhostCat, kapex, Jeffrey Chung, or David Makogan review the revised question?
    – user3509406
    Nov 20 at 10:25










  • Sorry, but I don't think that we can help here. First of all: this is really an interesting question. But I think it doesn't fit the scope of this community. You see, to answer the question, one would have to A) understand exactly what the exact set and nature of these features is. To then, B) one by one look into how Java is doing that. So even though you are no longer (explicitly) asking for a library, your question still isn't a good fit here. At least me, I do not see that re-opening this question is justified. And honestly: implicitly, this still asks for a library.
    – GhostCat
    Nov 20 at 10:44












  • In other words: when you start doing the required research to a certain degree, such as A) listing the exact features you are interested in and then B) do a bit of research on java ... to then finally present a question that reads "CML has this feature, and I think Java has this equivalent (or is missing that)" then we might be able to confirm that, or add more details. But you would better ask one question for one feature, or at least group of related features.
    – GhostCat
    Nov 20 at 10:45






  • 1




    I see. Thanks for your comment.
    – user3509406
    Nov 20 at 11:23


















  • Questions asking for off-site resources (such books/tutorials, tools/libraries) are off-topic here.
    – GhostCat
    Nov 19 at 13:24










  • Can you, Andy Turner, GhostCat, kapex, Jeffrey Chung, or David Makogan review the revised question?
    – user3509406
    Nov 20 at 10:25










  • Sorry, but I don't think that we can help here. First of all: this is really an interesting question. But I think it doesn't fit the scope of this community. You see, to answer the question, one would have to A) understand exactly what the exact set and nature of these features is. To then, B) one by one look into how Java is doing that. So even though you are no longer (explicitly) asking for a library, your question still isn't a good fit here. At least me, I do not see that re-opening this question is justified. And honestly: implicitly, this still asks for a library.
    – GhostCat
    Nov 20 at 10:44












  • In other words: when you start doing the required research to a certain degree, such as A) listing the exact features you are interested in and then B) do a bit of research on java ... to then finally present a question that reads "CML has this feature, and I think Java has this equivalent (or is missing that)" then we might be able to confirm that, or add more details. But you would better ask one question for one feature, or at least group of related features.
    – GhostCat
    Nov 20 at 10:45






  • 1




    I see. Thanks for your comment.
    – user3509406
    Nov 20 at 11:23
















Questions asking for off-site resources (such books/tutorials, tools/libraries) are off-topic here.
– GhostCat
Nov 19 at 13:24




Questions asking for off-site resources (such books/tutorials, tools/libraries) are off-topic here.
– GhostCat
Nov 19 at 13:24












Can you, Andy Turner, GhostCat, kapex, Jeffrey Chung, or David Makogan review the revised question?
– user3509406
Nov 20 at 10:25




Can you, Andy Turner, GhostCat, kapex, Jeffrey Chung, or David Makogan review the revised question?
– user3509406
Nov 20 at 10:25












Sorry, but I don't think that we can help here. First of all: this is really an interesting question. But I think it doesn't fit the scope of this community. You see, to answer the question, one would have to A) understand exactly what the exact set and nature of these features is. To then, B) one by one look into how Java is doing that. So even though you are no longer (explicitly) asking for a library, your question still isn't a good fit here. At least me, I do not see that re-opening this question is justified. And honestly: implicitly, this still asks for a library.
– GhostCat
Nov 20 at 10:44






Sorry, but I don't think that we can help here. First of all: this is really an interesting question. But I think it doesn't fit the scope of this community. You see, to answer the question, one would have to A) understand exactly what the exact set and nature of these features is. To then, B) one by one look into how Java is doing that. So even though you are no longer (explicitly) asking for a library, your question still isn't a good fit here. At least me, I do not see that re-opening this question is justified. And honestly: implicitly, this still asks for a library.
– GhostCat
Nov 20 at 10:44














In other words: when you start doing the required research to a certain degree, such as A) listing the exact features you are interested in and then B) do a bit of research on java ... to then finally present a question that reads "CML has this feature, and I think Java has this equivalent (or is missing that)" then we might be able to confirm that, or add more details. But you would better ask one question for one feature, or at least group of related features.
– GhostCat
Nov 20 at 10:45




In other words: when you start doing the required research to a certain degree, such as A) listing the exact features you are interested in and then B) do a bit of research on java ... to then finally present a question that reads "CML has this feature, and I think Java has this equivalent (or is missing that)" then we might be able to confirm that, or add more details. But you would better ask one question for one feature, or at least group of related features.
– GhostCat
Nov 20 at 10:45




1




1




I see. Thanks for your comment.
– user3509406
Nov 20 at 11:23




I see. Thanks for your comment.
– user3509406
Nov 20 at 11:23












1 Answer
1






active

oldest

votes

















up vote
-1
down vote













There are a lot of such libraries, for different use cases. In order to choose suitable one, you should determine:




  • do you need concurrent programs to run in the same process (JVM memory), or in distributed environment


  • what are the concurrent parts of your program - threads only or also asynchronous procedure calls (APC)? APC have multiple modification: actors (Akka), Observer/Observables (RxJava), CompletableFutures (java.util.concurrent) etc.



For the simplest use case (threads only in single process) the best approach is to use BlockingQueues and Semaphores as shared channels.






share|improve this answer




























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    -1
    down vote













    There are a lot of such libraries, for different use cases. In order to choose suitable one, you should determine:




    • do you need concurrent programs to run in the same process (JVM memory), or in distributed environment


    • what are the concurrent parts of your program - threads only or also asynchronous procedure calls (APC)? APC have multiple modification: actors (Akka), Observer/Observables (RxJava), CompletableFutures (java.util.concurrent) etc.



    For the simplest use case (threads only in single process) the best approach is to use BlockingQueues and Semaphores as shared channels.






    share|improve this answer

























      up vote
      -1
      down vote













      There are a lot of such libraries, for different use cases. In order to choose suitable one, you should determine:




      • do you need concurrent programs to run in the same process (JVM memory), or in distributed environment


      • what are the concurrent parts of your program - threads only or also asynchronous procedure calls (APC)? APC have multiple modification: actors (Akka), Observer/Observables (RxJava), CompletableFutures (java.util.concurrent) etc.



      For the simplest use case (threads only in single process) the best approach is to use BlockingQueues and Semaphores as shared channels.






      share|improve this answer























        up vote
        -1
        down vote










        up vote
        -1
        down vote









        There are a lot of such libraries, for different use cases. In order to choose suitable one, you should determine:




        • do you need concurrent programs to run in the same process (JVM memory), or in distributed environment


        • what are the concurrent parts of your program - threads only or also asynchronous procedure calls (APC)? APC have multiple modification: actors (Akka), Observer/Observables (RxJava), CompletableFutures (java.util.concurrent) etc.



        For the simplest use case (threads only in single process) the best approach is to use BlockingQueues and Semaphores as shared channels.






        share|improve this answer












        There are a lot of such libraries, for different use cases. In order to choose suitable one, you should determine:




        • do you need concurrent programs to run in the same process (JVM memory), or in distributed environment


        • what are the concurrent parts of your program - threads only or also asynchronous procedure calls (APC)? APC have multiple modification: actors (Akka), Observer/Observables (RxJava), CompletableFutures (java.util.concurrent) etc.



        For the simplest use case (threads only in single process) the best approach is to use BlockingQueues and Semaphores as shared channels.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 19 at 13:21









        Alexei Kaigorodov

        9,63911028




        9,63911028















            Popular posts from this blog

            Wiesbaden

            Marschland

            Dieringhausen