CSCE 3600: Systems Programming - Spring 2010

Instructor: Paul Tarau, Associate Professor - see my home page for contact info and office hours

E-mail : t a r a u@cs.unt.edu
WWW : http://www.cs.unt.edu/~tarau
Address: Department of Computer Science, University of North Texas, P.O. Box 311366, Denton, Texas 76203, USA
Phone : Tel : +1-940-565-2806, +1-940-565-2767
Fax : +1-940-565-2799

Teaching Assistant: Sujit Kumar - see home page for contact info and office hours. See code shown in class here.

Please complete exit survey at http://www.cse.unt.edu/exitSurvey.cgi?CSCE+3600+001 and bring proof to the final exam.

Description: Introduction to the design and operation of systems software. Analysis is made of current system software technology,  including operating systems, language translation systems and file systems.

Syllabus

Prerequisites: Prerequisite(s): CSCE 2050 and 2610

Textbook: None, the course will be based on resources available online.

Useful links: C tutorial, pthreads tutorial

Evaluation:

 

The Student Evaluation of Teaching Effectiveness (SETE) is a requirement for all organized classes at UNT. This short survey will be made available to you at the end of the semester, providing you a chance to comment on how this class is taught.  I am very interested in the feedback I get from students, as I work to continually improve my teaching. I consider the SETE to be an important part of your participation in this class.

 

Assignment 1 – deadline Thu Feb 18 at noon.

Implement index checked integer array and test their performance by comparing it to standard array operations. The API looks like this:

 int * new_array()

 int array_set(*a,int index, int value)

 int array_get(*a,int index)

 void free_array(*a)

 

Assignment 2 – deadline Thu March 11, at noon. Using the pthread API implement a simple Linda server thread managing a blackboard on which at least 5 different client threads perform value<-in(key) and out(key,value) operations using tuples of the form

struct tuple {
  int key;
  int value;
}.

The blackboard operations are as follows:

   int in(int key): waits until a tuple matching key (a small int) is available, then it returns its associated value
   void out(int key, int value): adds a tuple containing <key,value> to the blackboard, possibly resulting in waking up a thread waiting for a matching key
   void all(): prints out a snapshot of the blackboard

Note that out operations are ignored when the key contains data that has not been consumed.

We need also 2 API operations

void new_server();

void new_client(void pf) where fp is the function pointer to the code the client executes

Write a comprehensive random testing module that triggers various operations based on values returned by the function rand().
Submit an example of run and a README.txt explaining how to compile and run your program, together with your sources all as a single *.zip file. Hint: you can use an array to store the blackboard array[key] with get/set a given value.

Assignment 3: deadline Tuesday, April 13 at noon

Using C’s random-access file API implement an efficient (O(1) for all operations) persistent Map that allows to associate values to keys  (both represented as strings of arbitrary length). The API looks as follows:

Map newMap(<filename.map>): creates and returns a new empty map backed by a random access file

void removeMap(<filename.map>): removes a persistent map if it is there

Map openMap(<filename.map>): opens and returns a persistent map backed by an existing  random access file

void closeMap(Map): closes the file associated to a persistent map 

void put(Map map, *char key, char* value): associates value to key (overwrites if a previous association exists)

char *get(Map map,char *key): returns the value associated to the key

void removeKey(Map map, char *key): removes a key from the map if there

Assignment 4: deadline Tuesday April 20 at noon. Write a shell script that finds all files named <myFile> in a directory <dir> or any of its subdirectories, recursively. Special care should be taken of symbolic links that may form cycles, to avoid infinite loops. Hint: take a look at:

http://partmaps.org/era/unix/shell.html and http://steve-parker.org/sh/sh.shtml

for hints on programming the sh shell.

 

Assignment 5. Due Tue May 4, at noon. Write a minimal HTTP server that can serve HTML pages (and possibly more) to multiple clients.