Hacker News new | comments | show | ask | jobs | submit login

> These three are all similar -- avoid threading. :-(

Perl gets a bad rep on threading because it's threads don't map to what many people consider the strong points of threads, which is light weight processes. Perl fails spectacularly in that regard, but if you want multi-process programming with a standard, well understood set of primitives for IPC, it's really quite nice. That is, the 'threads' module isn't all that great by itself, but when paired with 'threads::shared', it's really quite nice (as long as you are pre-spawning workers or don't require quick thread spawning).

For example, I love how locks are scope based, which makes the following possible:

  my $local_var = do { lock($lock_var) }
as well as:

  {
    lock($sync_var);
    $sync_var = "start!";
    cond_broadcast($sync_var);
  }



Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: