search

Home  >  Q&A  >  body text

java - for循环中异步转同步如何改造?

高洛峰高洛峰2823 days ago1077

reply all(3)I'll reply

  • 阿神

    阿神2017-04-18 10:11:30

    Try to modify it and use java.util.concurrent.CompletionService

    reply
    0
  • PHP中文网

    PHP中文网2017-04-18 10:11:30

    Production->Consumption->Production->Consumption....

    Such a request why Mao needs to open a thread

    reply
    0
  • ringa_lee

    ringa_lee2017-04-18 10:11:30

    消费者全部消费完数据之后,再执行for循环的第二次循环, then what’s the point of starting a thread? , just execute it synchronously

    reply
    0
  • Cancelreply