Parallel programming in Java

后端 未结 19 1150
时光说笑
时光说笑 2021-01-30 11:14

How can we do Parallel Programming in Java? Is there any special framework for that? How can we make the stuff work?

I will tell you guys what I need, think that I devel

19条回答
  •  粉色の甜心
    2021-01-30 11:16

    Is the Ateji PX parallel-for loop what you're looking for ? This will crawl all sites in parallel (notice the double bar next to the for keyword) :

    for||(Site site : sites) {
      crawl(site);
    }
    

    If you need to compose the results of crawling, then you'll probably want to use a parallel comprehension, such as :

    Set result = set for||{ crawl(site) | Site site : sites }
    

    Further reading here : http://www.ateji.com/px/whitepapers/Ateji%20PX%20for%20Java%20v1.0.pdf

提交回复
热议问题