ExpandCollapseNext Index

+ 1.1 flx_perf_lib1.flx

  // dispatcher test
  header r"""
  #include <string>
  #include <stdio.h>
  
  using namespace std;
  struct check {
    check() { printf("ctor %p\n",this); }
    ~check() { printf("dtor %p\n",this); }
  };
  """;
  
  type check = "check";
  
  var counter : int = 0;
  var counter2 : int = 0;
  
  proc handle_line()
  {
    //var checker : check;
    var line : string;
    &line <- read;
    ++counter;
    if counter == 100000 do
      counter = 0;
      ++counter2;
      print counter2;
      print "00 K threads\n";
    done
    ;
    &line <- read;
  }
  
  export proc handle_line of (1) as "line_handler_creator";