Request iocp Code

For everything that's not in any way related to PureBasic. General chat etc...
Rascal
User
User
Posts: 30
Joined: Mon Sep 17, 2007 11:06 pm

Request iocp Code

Post by Rascal »

Request iocp Code
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: Request iocp Code

Post by PB »

Fred, in another post to you, wrote:Such topic without any english-like question will be locked
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
pdwyer
Addict
Addict
Posts: 2813
Joined: Tue May 08, 2007 1:27 pm
Location: Chiba, Japan

Post by pdwyer »

Paul Dwyer

“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
User avatar
Rook Zimbabwe
Addict
Addict
Posts: 4322
Joined: Tue Jan 02, 2007 8:16 pm
Location: Cypress TX
Contact:

Post by Rook Zimbabwe »

request large amounts of cash and gold bullion... NOPE... don't see that either!
Binarily speaking... it takes 10 to Tango!!!

Image
http://www.bluemesapc.com/
User avatar
idle
Always Here
Always Here
Posts: 6011
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Post by idle »

Request Granted

@rook

please send us your bank account number , password, DOB, mothers maiden name and we'll send you $100,000,000 because your great, great... aunt from Nigeria, whom you never knew, or heard of, but of whom we're sure has a 99% DNA match with you and er everyone else for that matter, recently passed away and left you $100,000,000 dollars.
User avatar
pdwyer
Addict
Addict
Posts: 2813
Joined: Tue May 08, 2007 1:27 pm
Location: Chiba, Japan

Post by pdwyer »

Idle, you forgot "but we need you to send us $250 in advance to cover our banking fees"

:P
Last edited by pdwyer on Fri Dec 26, 2008 8:09 am, edited 1 time in total.
Paul Dwyer

“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
User avatar
idle
Always Here
Always Here
Posts: 6011
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Post by idle »

:lol:
Windows 11, Manjaro, Raspberry Pi OS
Image
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Post by Rings »

seems garbage or very bad english
moved to 'off topic'
SPAMINATOR NR.1
User avatar
pdwyer
Addict
Addict
Posts: 2813
Joined: Tue May 08, 2007 1:27 pm
Location: Chiba, Japan

Post by pdwyer »

Shameless plug! ;)
Paul Dwyer

“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
Mohawk70
Enthusiast
Enthusiast
Posts: 404
Joined: Thu May 11, 2006 1:04 am
Location: Florida, USA

Post by Mohawk70 »

Rings wrote:seems garbage or very bad english
moved to 'off topic'
Basically when you use IOCP you are letting the OS manage your IO requests. For both in OS and application IO
requests management is a complicated thing. If you let your application wait till the IO is complete, you loose
performance. Now if you are not waiting (doing it asynchronously) you should have some sort of mechanism
to know when your IO is complete. If you poll continuously, you loose efficiency, because much of the CPU cycle
is wasted looking if the IO is over or not. Now if you poll slowly you loose/compromise response time. There are
many ways of managing IO and one is using completion port.

So what you basically do is you create a completion port and associate handles to it (for instance SOCKET
handles). Now for each asynchronous IO (usually using overlapped IO) that you do on that handle, you get notification
on that port when it is over. So now your problem reduces to retrieving the notification as quickly as possible.
Completion port is nothing but a FIFO queue maintained by the OS.

The IOCP model is very efficient. It is scalable and do have multiprocessor support. IOCP handles the thread pool, no.
of concurrent running threads etc. The complexity is high as well (compared to the other models). In the context of
writing a server, you usually use this model when you have to maintain tens and thousands of connections. It is not
worth the time if you are writing a complex server code that uses IOCP model just for a few (maybe hundred) connections.

You can look up in the MSDN for APIs such as CreateIoCompletionPort(), GetQueuedCompletionStatus() etc..
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Post by SFSxOI »

@Rook Zimbabwe

Your wish has been granted, just respond to the email from the guy in Nigeria. He has your funds on deposit in a bank and only needs a little help from you to make sure you get what is yours.

:)
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8452
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

@Mohawk70: If you're going to quote Matthew Joy word for word from here:

http://www.codeguru.com/forum/archive/i ... 02250.html

it would be good form to give him the credit, don't you think?
BERESHEIT
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Busted!

:lol: :lol:
I may look like a mule, but I'm not a complete ass.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8452
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

Hehe, if you're going to steal something at least paraphrase. :wink: Of course the problem comes in when someone asks you to explain a portion in greater depth, then you're cooked.
BERESHEIT
User avatar
pdwyer
Addict
Addict
Posts: 2813
Joined: Tue May 08, 2007 1:27 pm
Location: Chiba, Japan

Post by pdwyer »

Maybe he is Matthew Joy! :D

Everyone is entitled to defend themselves 8)

(But the prosecution have a pretty strong case at the moment ;) )
Paul Dwyer

“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
Post Reply