Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jan 22nd, 2007, 10:20 PM   #1
sonu2die4
Newbie
 
Join Date: Jan 2007
Posts: 3
Rep Power: 0 sonu2die4 is on a distinguished road
Help with Semaphore implementation

Hello ,
I am a newbee and I want to implement a semaphore which will do the

following :
4 threads want to do a printf .
Thread A ----> print A
Thread B -----> print B
Thread C ----> print C
thread C-----> print D
and the output must be ABCD.
How to do this on a Borlad TC 3.0 running on a windows machine?
Thank You
Sonu
sonu2die4 is offline   Reply With Quote
Old Jan 24th, 2007, 4:55 PM   #2
jim mcnamara
Hobbyist Programmer
 
Join Date: Jun 2005
Location: New Mexico
Posts: 228
Rep Power: 4 jim mcnamara is on a distinguished road
1. Borland TC 3.0 does not support threads or memory sharing.

2. If you must do this with TC 3.0 use a "lock" file as a sempahore-like object.

3. TC 3.0 is a DOS compiler. DOS does not handle threads or context switching at all. It supports TSR's. I have no idea how you would run four processes and have them all execute in the same timespace. 4 TSR's?
How would you schedule the TSR's?

There are LOTS of free compilers - google for "C compiler download"
Unless you are locked into an old 286 machine that can't do Windows.
jim mcnamara is offline   Reply With Quote
Old Jan 24th, 2007, 5:12 PM   #3
sonu2die4
Newbie
 
Join Date: Jan 2007
Posts: 3
Rep Power: 0 sonu2die4 is on a distinguished road
Hi ,
Thank You very Much. It will be of very great help if you can just give me a brief idea of the code...so that i may run it on the linux...i have just loaded the linux on my system...so I will be able to do it there...however I want to get just a fail idea of the code in c
Regards
Vivek
sonu2die4 is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
c stack implementation thenewkid C 2 May 18th, 2006 7:49 PM
Perl-type Regular Expression Implementation SittingDuck Other Programming Languages 4 Dec 7th, 2005 11:30 AM
implementation of cpuid and graph in my benchmark programm chorijan C++ 0 Sep 7th, 2005 6:27 AM
queue implementation problems epswing C 6 Apr 20th, 2005 3:44 PM
Help with stack implementation ridley C++ 0 Feb 26th, 2005 2:26 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:08 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC