Beispiel #1
0
static void on_fs_callback(uv_fs_t *req) {
  UNWRAP(req);
  int ret_n;

  if (LUA_NOREF == holder->threadref || holder->use_lcb) {
    push_callback_no_obj(L, holder, FSR__CBNAME);
    ret_n = push_results(L, req);
    lua_call(L, ret_n, 0);
  } else { /* coroutines */
    ret_n = push_results(L, req);
    /*luv_lua_debug_stackdump(L, "RESUME");*/
    lua_resume(L, ret_n);
  }

  uv_fs_req_cleanup(req);
  lev_handle_unref(L, (LevRefStruct_t *)holder);
}
Beispiel #2
0
static void on_fs_callback(uv_fs_t *req) {
    UNWRAP(req);
    int ret_n;

    push_callback_no_obj(L, holder, FSR__CBNAME);
    ret_n = push_results(L, req);
    lua_call(L, ret_n, 0);

    uv_fs_req_cleanup(req);
    lev_handle_unref(L, (LevRefStruct_t *)holder);
}
void HestonML_Kernel_module::main_kernel_thread(void) {

    while(true) {

        wait(start_calc\_ev);
        regBank.STATUS.write(STATE\_BUSY);
        cout << "INFO: HestonML\_Kernel: Received COMMAND=START. @" << sc\_time\_stamp() << endl;
        
        uint32_t paths_done;
        for (paths\_done = 0 ; paths\_done < reg\_params.path\_cnt; paths\_done += block\_size) {
            heston\_ml_calc\_paths();
            push_results();
        }

        regBank.STATUS.write(STATE\_DONE);
        cout << "INFO: HestonML_Kernel: Done Writing " << 2*reg_params.path\_cnt 
            << " values to the output fifo." << " @" << sc\_time\_stamp() << endl;

        wait(sw\_ackn\_ev);
        regBank.STATUS.write(STATE\_IDLE);
        cout << "INFO: HestonML_Kernel: Received COMMAND=RESET. @" << sc\_time\_stamp() << endl; 
    }
}