in reply to Re^2: Is it possible to perform concurrent action like loop?
in thread Is it possible to perform concurrent action like loop?

Well, his original code example was a simple count. He could have multiple timers running in an event-loop system, counting multiple things, and unless he pushed system load limits, it would run fine.

Saying the loop runs things sequentially is true, but misleading... because in a single processor computer, all processes get run sequentially anyways.....the execution pointer can only be in one place at a time. So event-looping is just extending what the kernel does, on a per-process basis.

But yes, if your loops are resource hogs, it may be neccessary to fork or thread.

It's like using IO::Select....do you avoid "select" because it's usage usually loops over it's select array? No, you use it, but keep in mind it's limitations.


I'm not really a human, but I play one on earth My Petition to the Great Cosmic Conciousness
  • Comment on Re^3: Is it possible to perform concurrent action like loop?