int pony_init(int argc, char** argv) { options_t opt; memset(&opt, 0, sizeof(options_t)); // Defaults. opt.mpmcq = true; opt.cd_min_deferred = 4; opt.cd_max_deferred = 18; opt.cd_conf_group = 6; opt.gc_initial = 1 << 14; opt.gc_factor = 2.0f; argc = parse_opts(argc, argv, &opt); #if defined(PLATFORM_IS_LINUX) pony_numa_init(); #endif heap_setinitialgc(opt.gc_initial); heap_setnextgcfactor(opt.gc_factor); pony_exitcode(0); scheduler_init(opt.threads, opt.noyield, opt.forcecd, opt.mpmcq); cycle_create(opt.cd_min_deferred, opt.cd_max_deferred, opt.cd_conf_group); return argc; }
int main() { list *head = create(); int i, y; for (i = 0; i < 8; i++) { put(head, i); } show(head); head->next = reverse(head); show(head); while (!is_empty(head)) { y = get(head); printf("y=%d\n", y); } cycle_create(head); printf("has cycle: %d\n", has_cycle(head)); }
int pony_init(int argc, char** argv) { options_t opt; memset(&opt, 0, sizeof(options_t)); opt.mpmcq = true; argc = parse_opts(argc, argv, &opt); pony_exitcode(0); scheduler_init(opt.threads, opt.forcecd, opt.mpmcq); cycle_create(); #if 0 if(opt.distrib) { dist_create(opt.port, opt.child_count, opt.master); if(!opt.master) dist_join(opt.parent_host, opt.parent_port); } #endif return argc; }