Click here to Skip to main content
15,915,019 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralPlease help with Web Browser Pin
rrrado4-Nov-02 2:13
rrrado4-Nov-02 2:13 
GeneralCAnimateCtrl Pin
Marcus7774-Nov-02 2:10
sussMarcus7774-Nov-02 2:10 
GeneralResponding to WM Messages in a DLL Pin
Brigg Thorp4-Nov-02 1:48
Brigg Thorp4-Nov-02 1:48 
GeneralRe: Responding to WM Messages in a DLL Pin
Andreas Saurwein4-Nov-02 6:47
Andreas Saurwein4-Nov-02 6:47 
GeneralRe: Responding to WM Messages in a DLL Pin
Brigg Thorp4-Nov-02 7:53
Brigg Thorp4-Nov-02 7:53 
GeneralChange the background color of a static text control Pin
Daniel Strigl4-Nov-02 1:24
Daniel Strigl4-Nov-02 1:24 
GeneralRe: Change the background color of a static text control Pin
Michael P Butler4-Nov-02 1:46
Michael P Butler4-Nov-02 1:46 
GeneralSemaphore wait and signal!!!! Pin
tongc4-Nov-02 1:13
tongc4-Nov-02 1:13 
Hi!
I've encounter the following problem!
<br />
Writec pseudo code using semaphore function wait and signal to solve the following problem:<br />
<br />
A computer system has a pool of N idential printer attached.  Processes that wish to print must obtain an available printer.  Write two functions:<br />
<br />
int getPrinter(void);<br />
void releasePrinter(int printerID);<br />
<br />
getPrinter obtains an availble printer from the pool of N printers and return the printer number (0 to N-1) as its result.  releasePrinter takes a printer number and makes it available for use by other processes.<br />


Here is what i attempt at it

#define N //number of printer;
int numberOfPrinter = N;
int printer[N] //array of N printer;

getPrinter(void)
{
if numberOfPrinter > 0 Then
set printer[numberOfPrinter-1] = used
return numberOfPrinter-1
else
Block
}

releasePrinter(int printerID)
{
numberOfPrinter++;
set printer[printerID] = not used
}


Could you please give me any comment or any advise regarding above problem!

Thanks
GeneralRe: Semaphore wait and signal!!!! Pin
Gary Wheeler4-Nov-02 7:33
Gary Wheeler4-Nov-02 7:33 
QuestionCListCtrl Focus??? Pin
Daniel Strigl4-Nov-02 1:02
Daniel Strigl4-Nov-02 1:02 
AnswerRe: CListCtrl Focus??? Pin
Andreas Saurwein4-Nov-02 6:49
Andreas Saurwein4-Nov-02 6:49 
Questionshared memory between processes?? Pin
Anonymous4-Nov-02 1:01
Anonymous4-Nov-02 1:01 
AnswerRe: shared memory between processes?? Pin
Paul M Watt4-Nov-02 5:24
mentorPaul M Watt4-Nov-02 5:24 
AnswerRe: shared memory between processes?? Pin
ian mariano4-Nov-02 7:31
ian mariano4-Nov-02 7:31 
QuestionWhat reports can use in VC instead of Crystal? Pin
LaFlour4-Nov-02 0:56
LaFlour4-Nov-02 0:56 
Generalallowable instruction in kernel mode!! Pin
Anonymous4-Nov-02 0:44
Anonymous4-Nov-02 0:44 
GeneralRe: allowable instruction in kernel mode!! Pin
Paul M Watt4-Nov-02 5:27
mentorPaul M Watt4-Nov-02 5:27 
QuestionHow Can I Set Items' Images of Toolbar Pin
IMiracle4-Nov-02 0:39
IMiracle4-Nov-02 0:39 
AnswerRe: How Can I Set Items' Images of Toolbar Pin
viliam4-Nov-02 0:55
viliam4-Nov-02 0:55 
GeneralRe: How Can I Set Items' Images of Toolbar Pin
IMiracle4-Nov-02 1:03
IMiracle4-Nov-02 1:03 
General"multi-master" Pin
Anonymous4-Nov-02 0:41
Anonymous4-Nov-02 0:41 
GeneralRe: "multi-master" Pin
Maximilien4-Nov-02 2:52
Maximilien4-Nov-02 2:52 
GeneralGenerating a short delay (a few ms) Pin
LittleYellowBird3-Nov-02 23:58
LittleYellowBird3-Nov-02 23:58 
GeneralRe: Generating a short delay (a few ms) Pin
Vagif Abilov4-Nov-02 0:30
professionalVagif Abilov4-Nov-02 0:30 
GeneralRe: Generating a short delay (a few ms) Pin
LittleYellowBird4-Nov-02 2:21
LittleYellowBird4-Nov-02 2:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.