![]() |
| | #1 |
| Registered User Join Date: Nov 2009
Posts: 2
| Semaphore headache Code: srand((unsigned)time(0));
int random_integer;
int lowest=1, highest=2;
int range=(highest-lowest)+1;
for(int index=0; index<20; index++)
{
random_integer = lowest+int(range*rand()/(RAND_MAX + 1.0));
switch (random_integer)
{
case 1 : DWORD WINAPI READER1(LPVOID r);
break;
case 2 : DWORD WINAPI WRITER1(LPVOID n);
break;
|
| samguddy is offline | |
| | #2 |
| Rampaging 35 Stone Welsh Join Date: Apr 2007
Posts: 2,929
| 1. this isn't a visual basic forum 2. that isn't visual basic 3. your code does nothing 4. there are missing brackets at the end 5. you are not creating threads merely declaring the thread functions 6. Read the homework policy
__________________ He is free, you say. Ah! That is his misfortune… These men… [have] the most terrible, the most imperious of masters, that is, need. … They must therefore find someone to hire them, or die of hunger. Is that to be free? - Simon Linguet |
| abachler is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Semaphore algorithm | erasm | C Programming | 3 | 09-20-2009 11:04 AM |
| semaphore | menzeli | Linux Programming | 12 | 04-15-2007 09:26 AM |
| clueless about the semaphore object | y_cant_i_C | Windows Programming | 1 | 10-25-2006 01:03 PM |
| Semaphore Question | azamsharp1 | C Programming | 4 | 10-30-2005 09:01 AM |
| CreateSemaphore/ReleaseSemaphore | nrieger | Windows Programming | 2 | 08-03-2005 06:57 AM |