in reply to Re^3: Sharing large data structures between threads
in thread Sharing large data structures between threads

My apologies, I haven't used Coro myself but from the documentation if you are right then it is all very misleading as it does appear to provide multithreading and is a replacement for threads and threads::shared. If you read Audrey Tang's review of Coro:

Wow, I can't believe no-one had reviewed this module. In short, this is what Perl Threads should work like. After the fragile-but-fast Perl 5.5 threading thesis, and the slow-but-reliable Perl 5.6 ithreading antithesis, this is the perfect synthesis that gives you a fast and reliable threading model. Highly recommended.

One would think so no? Sorry for my ignorance.

  • Comment on Re^4: Sharing large data structures between threads

Replies are listed 'Best First'.
Re^5: Sharing large data structures between threads
by Corion (Patriarch) on Mar 07, 2011 at 19:47 UTC

    Coro provides what other languages call "Green Threads" or cooperative multitasking, which can be quite useful in keeping your (procedural) program flow while still allowing some parallelism in the sense that when one thread of execution blocks on IO, the interpreter can switch to another execution context. But there only ever is one thread executing at the same time.

    I never gave both, the documentation of Coro nor the reviews much credit, because the documentation tries to redefine the term "thread" in a way that includes Coro, and the review simply does not know much about Coro.

    Coro is quite useful, as it gives you some of the advantages of threads while avoiding the nasty disadvantages of threads, especially race conditions and missing locks cannot be problems with Coro, as all task switching is done explicitly.

      Hey thank you for clarifying, now I know better and will remember this next time :)