Re: IOCP touching my OVERLAPPED after my Write has completed



"Alberto Demichelis" <AlbertoDemichelis@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:4A9CBAEE-6F48-40F8-AF2A-023277E88CD3@xxxxxxxxxxxxxxxx

[...]

struct IORequest : public OVERLAPPED {
...stuff...
...data...
..
}

Main Thread ---------------------------

IORequest *req = AllocateRequest(); //commits a virtual page and
initializes
stuff
WSASendTo(socket, ..., req,....);

WorkerThread(aka completion routine)----------------------------

if(GQCS(req)) {
FreeRequest(req); //in debug I decommit the memory of this request
}
else
{
....error handling...
}

This seems OK at the first glance, but the devil is in the details. And you
have omitted all the details. I recommend that you post a minimal version of
the application that has the issue.

S


.



Relevant Pages


Loading