···11# tsched
2233-This project is the second assignment for CCOM-4017.
33+This project is the second assignment for CCOM-4017. Check out the [instructions](instructions.md).
4455I am using a sockets library I developed mysel. For more information on how the
66sockets library was developed, feel free to visit the repo:
+6-2
src/cluster.c
···4646 }
4747 // Left crit region
48484949- // Let the client know what just happened.
4949+ // Let the user know what just happened.
5050 log(INFO, "Consumer %zu:\n\tProcessing: %s for %d seconds.\n", tid, (const char*)proc.program.buf, proc.time);
5151- zumba(cliente, proc.program);
52515352 // Perform work.
5453 sleep(proc.time);
···8584 Procs procs = deserialize(out_buf, msg_len);
8685 for (size_t i = 0; i < procs.len; ++i) {
8786 Proc proc = procs.procs[i];
8787+ Buffer in_buf = bufcpy(proc.program);
88888989 // Put the proc in the queue (Enter crit region)
9090 mtx_lock(&pq_mtx); // down
9191 pq_insert(&pq, proc);
9292 mtx_unlock(&pq_mtx); // up
9393 // Leave crit region
9494+9595+ // Let the client know what is getting processed.
9696+ zumba(cliente, in_buf);
9797+ free(in_buf.buf);
9498 }
959996100 memset(out_buf.buf, 0, out_buf.len);
+1-1
src/edevice.c
···1414 // Create the socket
1515 IPv4 ip = parse_address(argv[1]);
1616 Port port = (Port)atoi(argv[2]);
1717- log(INFO, "Connecting to: %d.%d.%d.%d on port: %d", ip.bytes[0], ip.bytes[1], ip.bytes[2], ip.bytes[3], port);
1717+ log(INFO, "Connecting to: %d.%d.%d.%d on port: %d\n", ip.bytes[0], ip.bytes[1], ip.bytes[2], ip.bytes[3], port);
18181919 Enchufe enchufe = enchufa(ip, port);
2020 conecta(enchufe);