Changeset - 0cbd80119355
[Not reviewed]
default
0 1 0
LordOfWar - 16 years ago 2009-09-12 01:43:44

I'm back till I have to study for finals^^, i would like to make some modifications to the queue now that I have much more experience with linked lists, thanks to my cs-102 class.

I added some commented code to brainstorm the revised queue system, which I wish to discuss with everyone later today.

Ohnobinki, I has lots of questions for you :p
1 file changed with 17 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/server/distrend.c
Show inline comments
 
@@ -59,22 +59,24 @@ struct distrend_config
 
struct general_info {
 
  short int jobs_in_queue; //
 
  unsigned short int free_clients;
 
  unsigned short int rendering_clients;//
 
  unsigned short int total_finished_jobs; //
 
  unsigned int total_frames_rendered; //
 
  unsigned int highest_jobnum;
 
} general_info;
 

	
 

	
 

	
 
/*
 
  internally defined funcs's prototypes
 
*/
 
void status_report_generator(struct distrenjob **distrenjobs_head);
 
void distrenjob_remove(struct distrenjob **head, struct distrenjob *bj);
 

	
 
//struct distrenjob *head(); /*@TODO:declare struct with no starting data */
 
struct distrenjob *distrenjob_get(struct distrenjob *head, jobnum_t jobnum);
 

	
 
/* Global Vars, try to cut down on these */
 
jobnum_t jobnum = 0; // The next job number to create in the queue
 
int hcfjob; // Highest consecutively finished job
 
int highest_jobnum; // The job number of the most recently created job, this is used when creating new jobs
 
@@ -153,12 +155,27 @@ int start_data(){
 
void finish_frame(struct distrenjob *distrenjob, int frame){
 
  distrenjob->frameset[frame].status = 2;
 
  distrenjob->frameset[frame].time_to_render = (clock() - distrenjob[jobnum].frameset[frame].start_time); // Consider changing time-to-render to time-for-frame or something?
 
  general_info.total_frames_rendered++; // Increase total frames var for stats
 
}
 

	
 
/* This @TODO: replace queue function*/
 
/* This function creates a structure from starting data, then calls another function to actually add that struct to the queue
 
void make_blendjob(char *name, char *submitter, char *email, int priority, int start_frame, int end_frame){
 
  struct distrenjob *new_distrenjob;
 
  distrenjob->type = 1; /*@TODO: add type to blendjob struct
 
  distrenjob->name = name;
 
  distrenjob->submitter = submitter;
 
  distrenjob->email = email;
 
  distrenjob->priority = priority;
 
  distrenjob->frameset = frameset[end_frame - start_frame + 1];
 

	
 
  /* @TODO: change frame_num_struct_builder to add_blendjob_to_queue
 
  add_blendjob_to_queue(new_distrenjob);
 
}
 
 */
 

	
 
/** Queuer: Adds files to the queue */
 
int queue(struct distrenjob *distrenjob, int type, char *name, char *submitter, char *email, int priority, int mode, int spp, struct frameset *frameset) {
 
  // Type: 1 = blender, add more types later
 
  // jobnum is the next available job number
 
  if(type == 1){
0 comments (0 inline, 0 general)