nV News Forums


nV News Forums (http://www.nvnews.net/vbulletin/index.php)
-   Software Development (http://www.nvnews.net/vbulletin/forumdisplay.php?f=53)
-   -   Semaphores in C (http://www.nvnews.net/vbulletin/showthread.php?t=87333)

Tuork 03-01-07 02:43 PM

Semaphores in C
Hello again all. Today's topic is the use of semaphores to protect the screen in C-Unix.

Basically, I have a a program that uses threads to display and add paths of "shared files". There's a string array that holds them.

Basically, printList, addToList and openFile are the three functions I have, and each must work through threads.

I have the threads figured out, but I'm stumped as how to protect the screen so that stuff is printed in the apropriate order.

Any idea?
This project is due tomorrow midnight. Any suggestions are welcome with open arms.

Tuork 03-02-07 12:07 AM

Re: Semaphores in C

Neeeeeeeeeever mind... got it to work.

No I need to work on figuring out how tocompare efficiency of thread vs. process creation.

Looking up ways to check the system time (in milliseconds, mind you).
Anyone have any bright ideas?

All times are GMT -5. The time now is 10:26 PM.

Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.