Go Back   nV News Forums > Software Forums > Software Development

Newegg Daily Deals

Reply
 
Thread Tools
Old 03-01-07, 03:43 PM   #1
Tuork
Official pain in the ass
 
Tuork's Avatar
 
Join Date: May 2003
Location: 127.0.0.1
Posts: 1,197
Send a message via MSN to Tuork
Question 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.
__________________
My avatar: "An obscure and non sensical pattern made to get people to post what they think it is" - Vamp

Dimitri:
Dell XPS M1530
Core2Duo T5550 1.86Ghz | 3GB DDR2 | 8600M GT 256MB | 250GB Hdd | BenQ FP202W 20" LCD | MX1000 mouse | Inspire T5400 5.1
Tuork is offline   Reply With Quote
Old 03-02-07, 01:07 AM   #2
Tuork
Official pain in the ass
 
Tuork's Avatar
 
Join Date: May 2003
Location: 127.0.0.1
Posts: 1,197
Send a message via MSN to Tuork
Default Re: Semaphores in C

EDIT!

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?
__________________
My avatar: "An obscure and non sensical pattern made to get people to post what they think it is" - Vamp

Dimitri:
Dell XPS M1530
Core2Duo T5550 1.86Ghz | 3GB DDR2 | 8600M GT 256MB | 250GB Hdd | BenQ FP202W 20" LCD | MX1000 mouse | Inspire T5400 5.1
Tuork is offline   Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 09:31 AM.


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