Re: output.c error in multithreaded program
From: Joe (not_at_home.com)
Date: 12/27/04
- Next message: Charles Brown: "Re: How to get ride off this warning ?"
- Previous message: Joe: "Re: output.c error in multithreaded program"
- In reply to: Joseph M. Newcomer: "Re: output.c error in multithreaded program"
- Next in thread: Joseph M. Newcomer: "Re: output.c error in multithreaded program"
- Reply: Joseph M. Newcomer: "Re: output.c error in multithreaded program"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 27 Dec 2004 12:28:13 -0000
"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message
news:81dvs0hgpp195fhu2usp9j6pj37i772srt@4ax.com...
> CWinThread::Create is essentially AfxBeginThread. Rarely is it necessary
to create an
> instance of CWinThread and start it separately.
>
> pThread = (CThreadType1 *)AfxBeginThread(CThreadType1::ThreadFunc,
ThreadParams);
> >Firstly.
> >#####
> >
> >I want to set up priorites for the
> >threads to access the internet - but I could find any examples so I set
up
> >this structure using semaphores. I include the function desc which should
> >explain my rationale
> >
>
>dwRet=GetHttpFileHarness(LOW_PRIORITY,pThrPars->m_strServerName,pThrPars->m
_
> >strObject, pThrPars,FALSE);
> ****
> I don't know what you mean by "priorities". Do you mean that requests will
not be in FIFO
> order? That's easy: just modify your queue insertion routine to put the
request in the
> queue in priority order.
Well I was trying to be clever. Dont forget there are several processes with
several groups.
So I dont have a single queue.
The application sees type A header data as more important than C. I didn't
want a process thread drilling a header page having to wait for 20 type C
threads to finish downloading their pages in another group or even another
process entirely.
The other motivation was that I dont want to hit the server hard, I restrict
the global semaphores to 6 in total - so I can only be making 6 requests at
a time. A new type 'A' request may get stuck behind 100 type C requests if I
can't have some sort of prioritisation.
I simply couldn't/can't work out how to do this in an elegant way - hence my
brute-force hard-coding approach to always leave 2 slots clear for type A
HTTP requests.
- Next message: Charles Brown: "Re: How to get ride off this warning ?"
- Previous message: Joe: "Re: output.c error in multithreaded program"
- In reply to: Joseph M. Newcomer: "Re: output.c error in multithreaded program"
- Next in thread: Joseph M. Newcomer: "Re: output.c error in multithreaded program"
- Reply: Joseph M. Newcomer: "Re: output.c error in multithreaded program"
- Messages sorted by: [ date ] [ thread ]