Hi PF,
I'm working on a program that requires measuring how long it takes a given computer to process a certain task, but am having trouble coming up with algorithms that won't take most computers a trivial amount of time to perform. The only one I've got so far is recursively computing...
Hi PF,
I am trying to write a program that utilizes a for loop that skips the current iteration (via continue) if it takes too long (for instance, longer than 20 seconds, else it finishes the current iteration as per normal), but am not sure how to best do this.
Does anyone know of a way...
Ooh, I think that fixed it! Thank you so much. Now hopefully I can actually get to the multi-threading part and actually get to the intended practice. :P
Hello all,
I am experiencing some odd output behavior from a program that I am working on:
Header file
#include <pthread.h>
struct ringbuf_t
{
pthread_mutex_t mutex;
pthread_cond_t cond_full;
pthread_cond_t cond_empty;
int bufsiz;
int front;
int back;
char* buf...
Hi all,
Although my homework assignment centers around practicing multi-threading type stuff (by implementing a ring buffer), my question is more centered on trying to figure something out that has nothing to do with multi-threading but nevertheless has me stumped on the assignment itself...
Homework Statement
Need to write my own shell in C for a Programming assignment. It must also support piping, redirection, and appending.
Homework Equations
The professor provided a preliminary version of the program that supports piping, but not redirection of either input or...
Well, after quite a bit of trial-and-error and brainstorming, I've solved the assignment more or less on my own, though I did get a friend's advice on one or two finer points. Thanks to everyone who helped me along on here.
But due to the code as-is checking if a potential move would result in hopping to a number that is greater than the one at the current position, the program does not wind up visiting the same cell twice, nor does infinite recursion take place as-is. My problem remains how to change it to go...
Also, I understand about checking all starting positions and streamlining and so forth, but for the moment I'd like to test using the starting position of the posted solution. I can always modify the code to check all possible starting positions later. All it does for me as-written is give a...