![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Jan 2007
Posts: 3
Rep Power: 0
![]() |
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 |
|
|
|
|
|
#2 |
|
Hobbyist Programmer
Join Date: Jun 2005
Location: New Mexico
Posts: 228
Rep Power: 4
![]() |
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. |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Jan 2007
Posts: 3
Rep Power: 0
![]() |
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 |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
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 |