Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Zombywuf
Mar 29, 2008

Max Facetime posted:

whereas without the simple HTTP GET/PUT/POST/DELETE API existing point B) is where you get to start from!

Doctor it hurts when I do this

Adbot
ADBOT LOVES YOU

Opinion Haver
Apr 9, 2007

coffeetable posted:

quantum computers are not hypercomputers in any sense i've seen. like you said they can at most solve problems in PSPACE, and the inclination in the field at the moment is that they're almost certainly in NP too. in fact, while no-one's expecting it i don't think anyone would be ~too~ surprised if it turned out that BQP = BPP and they're only as powerful as probabilistic computers.

i was talking with a friend the other day about how information/complexity theory relates to the physical universe and the conclusion we reached was basically that the laws of physics are set up so that you can do sort of neat things but you always get hosed over when you try to do really cool poo poo (FTL impossibility, the fact that you probably can't solve NP-complete problems with quantum computers and even if you could they're really hard to build, the rocket equation meaning that going to space is ballfuckingly hard)

then he suggested that the reason the universe hates us so much is that we're all in a simulation run in a universe where FTL and teleportation and all that is possible and we're basically extremophiles that evolved in a simulation that the aliens cooked up as like 'hey let's see if things can even live in this wacky-rear end nondeterministic universe'

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

Mr Dog posted:

They basically mean the same thing for streams (i.e. network sockets), but if you're dealing with a large file on disk then you can kick off multiple simultaneous overlapping transfers using async IO (the user-mode data structure for this on Windows is even called OVERLAPPED). So, asynchronous IO is strictly more powerful than nonblocking IO, provided that you have a unified mechanism to gather completion/availability on those channels.

"fun" fact, OVERLAPPED is actually a kernel mode structure, at least the first two fields (Internal/InternalHigh). internally, it's known as IO_STATUS_BLOCK: what OVERLAPPED calls Internal is a field called Status, which the kernel sets to STATUS_PENDING as soon as the request (IRP) is enqueued, and to a different status code as soon as it's completed, and InternalHigh is a field called Information, which is where I/O drivers can return up to a pointer size (this is where e.g. NtWriteFile returns the number of bytes written). you can check if a request is complete in a non-blocking way without a system call: just do an atomic read of Internal and see if it equals STATUS_PENDING or not (or better yet, don't, and use GetOverlappedResult like you should)

the other fields (Offset/OffsetHigh and hEvent) actually are input parameters to I/O system calls and don't really belong in OVERLAPPED, because they are only used when the request is submitted and not accessed beyond that. an arbitrary pointer to user-defined data would have been more useful, for the people who cannot wrap their minds around CONTAINING_RECORD at least

this used to be forbidden knowledge, as you can guess from the "Internal" field names, but I see from recent documentation that they stopped pretending there was any magic to OVERLAPPED

Mr Dog posted:

NT on the other hand is exclusively nonblocking at the core, the usermode APIs can just block on your behalf to save you the trouble for unimportant poo poo.

and it's a pretty terrible idea, because for example this is how NtWriteFile operates in synchronous mode:

  • lock file object
  • prepare request (makes sense, the file has to be locked to safely access the "current offset" field)
  • send request (ok I guess, it's usually a non-blocking operation, except for weirdo SCSI port where all SCSI commands are forced to complete synchronously)
  • wait for the file object to be signaled at the end of the request (reasonable, it uses an event object embedded in the file object, have to synchronize access to it... wait what what what)
  • advance the "current offset" pointer by the amount of bytes written (yeah whatever)
  • unlock file object (fuuuuuuuuuuuuuuuu isn't this a little too late guys???)

yeah. synchronous I/O performs what could possibly be a really long wait inside a critical region, tying up the file object for the entire duration of the I/O request, which in the case of a pipe's read end could end up being forever. you can't even perform standard object manager operations on the file object, they will synchronize with I/O (this is why for years there was no equivalent to lsof on Windows: if you tried to query the name of a file, you could end up stuck waiting for an I/O request that may as well never complete. with no way to cancel the wait, either). you can't even close the handle, NtClose will synchronize on the file object's lock and stay stuck there. I guess Cutler never heard of condition variables

I make it sound scary, but this is pretty much a non-issue, because typically you use synchronous I/O with nice polite behaving disk files, and asynchronous I/O with no-good delinquent communication ports. the only exception in normal use is the case in which you read from stdin is an anonymous pipe, which are opened for synchronous I/O and there is jack poo poo you can do about it. you can't even use ReOpenFile (which used to be another dirty little secret of Windows I/O, a day-zero undocumented feature that those "in the know" implemented with hand-rolled NtOpenFile wrappers years before Microsoft finally caved and admitted it was useful functionality with no equivalent), because that counts as a new connection (i.e. parallel stream) on the same pipe

it took until Windows Vista for the issue to be solved in an extremely unsubtle way, with the CancelSynchronousIo API, which at least lets you retake control while preserving the horrible behavior forever for backwards compatibility. thank god for CancelIoEx too, whoever came up with CancelIo is an idiot. still no way to cancel arbitrary waits reliably (like signals do on UNIX), but however handy it can be in small programs, it has never been considered a good design

Mr Dog posted:

sockets (well, formally they aren't, but every non-toy network application depends on them actually being HANDLEs)

sockets are guaranteed to be file handles since Winsock 2.0. even if your Winsock provider is implemented entirely in user mode, Windows will wrap it in a real file handle before returning it.

Mr Dog posted:

You have a single, scalable event gathering mechanism that works with everything

sadly no, it's neither "single" nor "scalable". you can't wait for multiple I/O requests to complete like you'd wait for multiple events. there's a hard limit of 64 objects you can wait on at a time, probably to limit contention on what once was a single spinlock shared by the scheduler, all synchronization primitives and software interrupts. for how maligned select/poll are, Windows has no real equivalent (select/WSAPoll only operate on sockets). yes, completion ports are great, but they are not waitable themselves (arguably not a real issue), and you can only use completion ports with files, not events or other kinds of waitable objects (well, except for jobs), which greatly limits their usefulness. this is a deep issue, caused by the fact that the Windows kernel has no less than three specialized, incompatible notification mechanisms: waitable objects, KQUEUEs (== I/O completion ports) and asynchronous I/O, and thank god asynchronous I/O can at least interact with the other two (it can signal an event or post to a completion por). four if you include APCs (UNIX signals except useless) and comedy option CreateRemoteThread (actually how terminal interrupts like CTRL-C are sent). not even going to touch LPC ports (think sockets except completely broken and not asynchronous or even waitable until Windows Vista or so) and event pairs (microkernel debris that we're all better without)

Linux's (belated) wait queues and futexes were a much better unified notification architecture: callback-based notification, and a spinlock for each wait queue (for functions that operated on two queues at the same time, to avoid deadlocks, the two spinlocks were acquired in virtual address order. cute). maybe they weren't the finely tuned instruments that the Windows stuff was, but they made it up in simplicity and flexibility

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

Opinion Haver posted:

then he suggested that the reason the universe hates us so much is that we're all in a simulation run in a universe where FTL and teleportation and all that is possible and we're basically extremophiles that evolved in a simulation that the aliens cooked up as like 'hey let's see if things can even live in this wacky-rear end nondeterministic universe'

assholes

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

Opinion Haver posted:

i was talking with a friend the other day about how information/complexity theory relates to the physical universe and the conclusion we reached was basically that the laws of physics are set up so that you can do sort of neat things but you always get hosed over when you try to do really cool poo poo (FTL impossibility, the fact that you probably can't solve NP-complete problems with quantum computers and even if you could they're really hard to build, the rocket equation meaning that going to space is ballfuckingly hard)

then he suggested that the reason the universe hates us so much is that we're all in a simulation run in a universe where FTL and teleportation and all that is possible and we're basically extremophiles that evolved in a simulation that the aliens cooked up as like 'hey let's see if things can even live in this wacky-rear end nondeterministic universe'

here's a fun lil' thought experiment for you: the reason we bother with computers at all is because they allow us to model things cheaply, right? well suppose you had a really goddamn huge computer. natural thing to do would be to simulate a universe.

well, you set up your sim and start messing with parameters and it turns out most universes are boring. either totally stable or totally chaotic. but one day you roll the dice and well would you look at that, there's life, there's complexity down there! oh wow, we could learn something here, let's keep this one running.

anyway you go for a drink or three and come back next morning and lookit that, the beings in yr lil' toy universe have decided you know what would be great? if they could model their own universe too. so they've knocked up a computer and flipped through all the lovely boring universes too and found another interesting universe full of complexity and holy shi' the guys in that universe are trying to model..

etc.

the best solution ive seen to the goldilocks problem is this. entities subject to selection pressures have a huge incentive to model the world around them, and that means that a universe capable of supporting structures complex enough to make their own simulations have a pressure to create more universes capable of supporting structures complex enough to make their own simulations

anyway under this theory, you're only ever gonna simulate universes that don't grind to a halt by say having too many particles in one place or by getting stuck in paradoxes or whatevs, so it's understandable that our universe doesn't have anything pathological like that

coffeetable fucked around with this message at 17:02 on Nov 26, 2013

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY
that aside, don't conflate things like P != NP with the cosmic censorship hypothesis or whatevs. totally different kinds of impossibility

computer parts
Nov 18, 2010

PLEASE CLAP

coffeetable posted:

here's a fun lil' thought experiment for you: the reason we bother with computers at all is because they allow us to model things cheaply, right? well suppose you had a really goddamn huge computer. natural thing to do would be to simulate a universe.

well, you set up your sim and start messing with parameters and it turns out most universes are boring. either totally stable or totally chaotic. but one day you roll the dice and well would you look at that, there's life, there's complexity down there! oh wow, we could learn something here, let's keep this one running.

anyway you go for a drink or three and come back next morning and lookit that, the beings in yr lil' toy universe have decided you know what would be great? if they could model their own universe too. so they've knocked up a computer and flipped through all the lovely boring universes too and found another interesting universe full of complexity and holy shi' the guys in that universe are trying to model..

etc.

that reminds me of this story which i swear i read in a short story collection somewhere but maybe it was just online

Opinion Haver
Apr 9, 2007

computer parts posted:

that reminds me of this story which i swear i read in a short story collection somewhere but maybe it was just online

i was thinking of this

crazypenguin
Mar 9, 2005
nothing witty here, move along

coffeetable posted:

like you said they can at most solve problems in PSPACE, and the inclination in the field at the moment is that they're almost certainly in NP too.

This is worded confusingly, so I just want to clarify: quantum computers probably can't solve NP-complete problems any better than classical ones.

there's only like 5 useful quantum algorithms, and nobody can prove those problems aren't just in P anyway.

quote:

in fact, while no-one's expecting it i don't think anyone would be ~too~ surprised if it turned out that BQP = BPP and they're only as powerful as probabilistic computers.

Oh people would be surprised by that result. a lot. it'd be the biggest result in physics since the Higgs boson in the 60s, for one thing.

It's just possible, that's all. vastly more possible than P=NP. There's also a lot of people who want it to be true, because it would suit their philosophical inclinations about the nature of reality.

Actually, the one theorists are starting to suspect is P=BPP thanks to some relatively recent results in random number generators.

qntm
Jun 17, 2009

Opinion Haver posted:

then he suggested that the reason the universe hates us so much is that we're all in a simulation run in a universe where FTL and teleportation and all that is possible and we're basically extremophiles that evolved in a simulation that the aliens cooked up as like 'hey let's see if things can even live in this wacky-rear end nondeterministic universe'

ah, the strong misanthropic principle

qntm
Jun 17, 2009

computer parts posted:

that reminds me of this story which i swear i read in a short story collection somewhere but maybe it was just online

if that appeared in a short story collection anywhere let me know because someone owes me money

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

coffeetable posted:

that aside, don't conflate things like P != NP with the cosmic censorship hypothesis or whatevs. totally different kinds of impossibility

the idea goes that FTL === violation of causality, and violation of causality === P = NP

E: and bonus P = PSPACE apparently [Aaronson 2009]

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av
time loop logic is the single hottest computing model ever. computers become machines that, given a reliable answer checker, always give you the correct answer the first time, before they even interact with the answer checker

since I read about it, I can't watch fiction with time machines anymore. the time twister from Harry Potter is especially infuriating, it would be so easy to turn that into an universal theorem prover/encryption cracker :argh:

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

crazypenguin posted:

Oh people would be surprised by that result. a lot. it'd be the biggest result in physics since the Higgs boson in the 60s, for one thing.

It's just possible, that's all. vastly more possible than P=NP. There's also a lot of people who want it to be true, because it would suit their philosophical inclinations about the nature of reality.

Actually, the one theorists are starting to suspect is P=BPP thanks to some relatively recent results in random number generators.

the chat i was hearing about BPP vs BQP was off the back of the PRIMES in P result, which i thought was a large part of what got people to sit up and start thinking about P vs BPP as well. the idea is that if primality testing is in P when we really thought it wasn't, are we all that sure about factoring not being in P or BPP? and if it is, and fast factoring is the headline result for quantum computers, then BQP vs BPP seems worth reconsidering.

but you're right that my saying "no-one would be too surprised" is probably going too far. within the complexity community it seemed like it wouldn't knock anyone over, but i was only studying that stuff for a year so it's likely you know it better.


hackbunny posted:

the idea goes that FTL === violation of causality, and violation of causality === P = NP

E: and bonus P = PSPACE apparently [Aaronson 2009]

causality violation wouldn't mean P = NP. it'd mean NP problems (and a whole lot more) are efficiently soluble, but it wouldn't change anything about the definitions of P and NP.

e: it could be argued that as a TM is a model for effective computation, equipping it with a time machine makes sense if the universe has one too, but as a mathematician that leads to a completely different problem

coffeetable fucked around with this message at 18:20 on Nov 26, 2013

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

coffeetable posted:

causality violation wouldn't mean P = NP. it'd mean NP problems (and a whole lot more) are efficiently soluble, but it wouldn't change anything about the definitions of P and NP.

same difference, it's the computer singularity either way

Opinion Haver
Apr 9, 2007

hackbunny posted:

time loop logic is the single hottest computing model ever. computers become machines that, given a reliable answer checker, always give you the correct answer the first time, before they even interact with the answer checker

since I read about it, I can't watch fiction with time machines anymore. the time twister from Harry Potter is especially infuriating, it would be so easy to turn that into an universal theorem prover/encryption cracker :argh:

in yudkowsky's fanfic (i read some of it when i was really bored once ok) he actually tries doing this and he just gets a note saying 'DON'T MESS WITH TIME TRAVEL'

Zombywuf
Mar 29, 2008

Closed timelike loops give us P in O(1) and simple proofs of Goldbach's conjecture, they could even make webapps responsive.

spongeh
Mar 22, 2009

BREADAGRAM OF PROTECTION
in some lighter news:

http://scalenpm.org/

give us $200k to solve something that every other language, and operating system, has managed to solve. typically by just publishing flat files onto a cdn.

Shaggar
Apr 26, 2006

spongeh posted:

in some lighter news:

http://scalenpm.org/

give us $200k to solve something that every other language, and operating system, has managed to solve. typically by just publishing flat files onto a cdn.

I was wondering why the site was so slow to come up and then it came up

double sulk
Jul 2, 2010

javascript is garbage

MononcQc
May 29, 2007

$ curl https://scalenpm.org
Moved Permanently. Redirecting to https://scalenpm.org/
$ curl https://scalenpm.org/
Moved Permanently. Redirecting to https://scalenpm.org/

it loops now :toot:

E: they finally fixed it after ~15 minutes.

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

Opinion Haver posted:

in yudkowsky's fanfic (i read some of it when i was really bored once ok) he actually tries doing this and he just gets a note saying 'DON'T MESS WITH TIME TRAVEL'

I hate you for making me go to tvtropes

the tvtropes page for Harry Potter and the Methods of Rationality has gotten so big it's divided in alphabetized sections :cripes:

what the gently caress happened to tvtropes

when did it reach runaway criticality

Opinion Haver
Apr 9, 2007

hackbunny posted:

I hate you for making me go to tvtropes

the tvtropes page for Harry Potter and the Methods of Rationality has gotten so big it's divided in alphabetized sections :cripes:

what the gently caress happened to tvtropes

when did it reach runaway criticality

probably around the time that they decided that you could also list 'subversions' and 'aversions' (i.e., not actually using the trope)

Deacon of Delicious
Aug 20, 2007

I bet the twist ending is Dracula's dick-babies
oh god change the subject

tef and shaggar start arguing about something

sulk and pollyanna start arguing about something neither of you are qualified to talk about

something

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY
i learnt about DCI today and thinking about it for a while solved a big problem i was having with how to structure my project :shobon:

coffeetable fucked around with this message at 19:28 on Nov 26, 2013

double sulk
Jul 2, 2010

Deacon of Delicious posted:

oh god change the subject

tef and shaggar start arguing about something

sulk and pollyanna start arguing about something neither of you are qualified to talk about

something

i dont think "javascript is garbage" is much of an argument. i'm not really trying to argue anything atm. spirit of the holiday season and all

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison

Deacon of Delicious posted:

oh god change the subject

tef and shaggar start arguing about something

sulk and pollyanna start arguing about something neither of you are qualified to talk about

something

python is pretty good, i heard theres a new beta out

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

serewit posted:

python is pretty good, i heard theres a new beta out

use pypy

Forums Terrorist
Dec 8, 2011

perlang is p cool

fritz
Jul 26, 2003

Opinion Haver posted:

in yudkowsky's fanfic (i read some of it when i was really bored once ok) he actually tries doing this and he just gets a note saying 'DON'T MESS WITH TIME TRAVEL'

i saw him come into james nicoll's live journal once and talk about how when that thing is finished he's going to start campaigning for a hugo for it and that would be amazing just for the intersection of crazy lesswrong robots and crazy old timey science fiction people who are still mad about an original harry potter winning a hugo

tef
May 30, 2004

-> some l-system crap ->

Deacon of Delicious posted:

tef and shaggar start arguing about something

sorry i can't right now i'm about to teach rubyists how to fold origami in buenos aires

Sapozhnik
Jan 2, 2005

Nap Ghost

hackbunny posted:

"fun" fact, OVERLAPPED is actually a kernel mode structure, at least the first two fields (Internal/InternalHigh). internally, it's known as IO_STATUS_BLOCK: what OVERLAPPED calls Internal is a field called Status, which the kernel sets to STATUS_PENDING as soon as the request (IRP) is enqueued, and to a different status code as soon as it's completed, and InternalHigh is a field called Information, which is where I/O drivers can return up to a pointer size (this is where e.g. NtWriteFile returns the number of bytes written). you can check if a request is complete in a non-blocking way without a system call: just do an atomic read of Internal and see if it equals STATUS_PENDING or not (or better yet, don't, and use GetOverlappedResult like you should)

the other fields (Offset/OffsetHigh and hEvent) actually are input parameters to I/O system calls and don't really belong in OVERLAPPED, because they are only used when the request is submitted and not accessed beyond that. an arbitrary pointer to user-defined data would have been more useful, for the people who cannot wrap their minds around CONTAINING_RECORD at least

this used to be forbidden knowledge, as you can guess from the "Internal" field names, but I see from recent documentation that they stopped pretending there was any magic to OVERLAPPED


and it's a pretty terrible idea, because for example this is how NtWriteFile operates in synchronous mode:

  • lock file object
  • prepare request (makes sense, the file has to be locked to safely access the "current offset" field)
  • send request (ok I guess, it's usually a non-blocking operation, except for weirdo SCSI port where all SCSI commands are forced to complete synchronously)
  • wait for the file object to be signaled at the end of the request (reasonable, it uses an event object embedded in the file object, have to synchronize access to it... wait what what what)
  • advance the "current offset" pointer by the amount of bytes written (yeah whatever)
  • unlock file object (fuuuuuuuuuuuuuuuu isn't this a little too late guys???)

yeah. synchronous I/O performs what could possibly be a really long wait inside a critical region, tying up the file object for the entire duration of the I/O request, which in the case of a pipe's read end could end up being forever. you can't even perform standard object manager operations on the file object, they will synchronize with I/O (this is why for years there was no equivalent to lsof on Windows: if you tried to query the name of a file, you could end up stuck waiting for an I/O request that may as well never complete. with no way to cancel the wait, either). you can't even close the handle, NtClose will synchronize on the file object's lock and stay stuck there. I guess Cutler never heard of condition variables

I make it sound scary, but this is pretty much a non-issue, because typically you use synchronous I/O with nice polite behaving disk files, and asynchronous I/O with no-good delinquent communication ports. the only exception in normal use is the case in which you read from stdin is an anonymous pipe, which are opened for synchronous I/O and there is jack poo poo you can do about it. you can't even use ReOpenFile (which used to be another dirty little secret of Windows I/O, a day-zero undocumented feature that those "in the know" implemented with hand-rolled NtOpenFile wrappers years before Microsoft finally caved and admitted it was useful functionality with no equivalent), because that counts as a new connection (i.e. parallel stream) on the same pipe

it took until Windows Vista for the issue to be solved in an extremely unsubtle way, with the CancelSynchronousIo API, which at least lets you retake control while preserving the horrible behavior forever for backwards compatibility. thank god for CancelIoEx too, whoever came up with CancelIo is an idiot. still no way to cancel arbitrary waits reliably (like signals do on UNIX), but however handy it can be in small programs, it has never been considered a good design


sockets are guaranteed to be file handles since Winsock 2.0. even if your Winsock provider is implemented entirely in user mode, Windows will wrap it in a real file handle before returning it.


sadly no, it's neither "single" nor "scalable". you can't wait for multiple I/O requests to complete like you'd wait for multiple events. there's a hard limit of 64 objects you can wait on at a time, probably to limit contention on what once was a single spinlock shared by the scheduler, all synchronization primitives and software interrupts. for how maligned select/poll are, Windows has no real equivalent (select/WSAPoll only operate on sockets). yes, completion ports are great, but they are not waitable themselves (arguably not a real issue), and you can only use completion ports with files, not events or other kinds of waitable objects (well, except for jobs), which greatly limits their usefulness. this is a deep issue, caused by the fact that the Windows kernel has no less than three specialized, incompatible notification mechanisms: waitable objects, KQUEUEs (== I/O completion ports) and asynchronous I/O, and thank god asynchronous I/O can at least interact with the other two (it can signal an event or post to a completion por). four if you include APCs (UNIX signals except useless) and comedy option CreateRemoteThread (actually how terminal interrupts like CTRL-C are sent). not even going to touch LPC ports (think sockets except completely broken and not asynchronous or even waitable until Windows Vista or so) and event pairs (microkernel debris that we're all better without)

Linux's (belated) wait queues and futexes were a much better unified notification architecture: callback-based notification, and a spinlock for each wait queue (for functions that operated on two queues at the same time, to avoid deadlocks, the two spinlocks were acquired in virtual address order. cute). maybe they weren't the finely tuned instruments that the Windows stuff was, but they made it up in simplicity and flexibility

ah ok

I never actually worked with completion queues, though winsock kinda seems like a clusterfuck in general. i just thought io completion ports were like win32's version of aio signals except designed in from the beginning and available 10 years before the equivalent lunix poo poo

regardless, it's not hard for linux to outpace nt given that linux has the fantastically enviable ability to completely rearchitect core system frameworks beyond recognition (albeit incrementally with mandatory stable interim forms), tell oems to get hosed if they have a problem with that, and actually get away with it. e.g. getting rid of the big kernel lock and using rcu everywhere instead. something like that inside nt would have resulted in windows being stillborn or bearing a 10 ton cross for the last decade (compare to python's gil). even though he's kind of a dick you really have to respect cutler for mostly getting it right first time while the linux kids fumbled around in the dark like horny teenagers before sort of eventually figuring out what they were doing

granted though they DID replace vxds with wdm drivers way back when and they also made that massive breaking change to the audio and video driver models in vista as well. both of them treat the "system call" interface as sacrosanct too. hmm.

Max Facetime
Apr 18, 2009

Zombywuf posted:

Doctor it hurts when I do this

more REST is not the cure for REST

Deacon of Delicious
Aug 20, 2007

I bet the twist ending is Dracula's dick-babies

tef posted:

sorry i can't right now i'm about to teach rubyists how to fold origami in buenos aires

oh

well

the buenos aires part sounds like it could be nice

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord
tef is buenos aires really white like they say? I'm unironically waiting for a buenos aires version of this post

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

Mr Dog posted:

I never actually worked with completion queues, though winsock kinda seems like a clusterfuck in general.

eeeh, a little. if you absolutely must do I/O on Win32, just use asio, it's some quality poo poo

Mr Dog posted:

i just thought io completion ports were like win32's version of aio signals except designed in from the beginning and available 10 years before the equivalent lunix poo poo

they are. but on UNIX, the equivalents are more useful, they let you mix all sorts of objects. Windows is limited to I/O operations, you can't associate completion ports to event objects (which would make event objects actually useful/nonbroken, even). doubly so for communication port-like files (sockets, pipes, etc.): you can only wait for I/O operations, not for conditions on the file itself (like "data available"), what epoll calls a "level triggered" event. unless the driver for the file was so kind as to provide a "wait for condition" IOCTL, like named pipes do (I have to try using named pipe functions on sockets some time. IIRC sockets are created as pipe files, I wonder if they implement the NPFS IOCTLs too)


love this. love love love this. even if I never did get how it worked in preemptable kernels. but love this to tears. wish I had RCU everywhere

Mr Dog posted:

granted though they DID replace vxds with wdm drivers way back when

I love the ballsiness of WDM. they agreed on a subset of the I/O subsystem, then they rewrote/ported part of ntoskrnl.exe as a VxD (ntkern.vxd if I'm not mistaken) to implement it on Windows 98. and it wasn't that insane in context: they just added yet another kernel to the already busy Windows 98 kernelspace - which already supported 32-bit VxDs, 16-bit VxDs, real-mode DOS drivers and real-mode BIOS drivers

to the best of my knowledge, Windows 9x was the only OS insane enough to support running on drivers meant for bootcode. it was in fact an explicitly supported scenario: when you booted in safe mode, you accessed the hard disk through the (slow as gently caress) BIOS int 13h interface

it's important to note that this is, technically, impossible: on x86 you can't call real-mode code from protected mode, the CPU doesn't support it. so what Microsoft did was overwrite the RAM shadow of the ROM with a trampoline, and then crash the CPU with a triple fault. the CPU reboots in real mode and resumes execution from the trampoline, which calls the real-mode code you wanted to call but couldn't. brought to you by the same guys who used the invalid opcode trap as a syscall instruction, and when prompted by Intel engineers about desired improvements, asked for faster bad opcode traps (it was the fastest trap available, and "<1 byte invalid opcode> <4 bytes function identifier>" can be trivially patched at runtime into "<call opcode> <offset to function>" for kernel-kernel calls. Windows 9x was insane)

Windows NT instead does it the "right" way, by executing BIOS code in a v86 VM and sloooowly emulating in software the missing opcodes (v86 emulates an 8086). and it's only used for VGA stuff like full-screen text mode. you can find the real-mode address space mapped at the bottom of csrss.exe's address space for that purpose. another fun VGA fact: graphical DOS applications running in full screen directly call into the VGA BIOS, and this is how SimCity 2000 for DOS could lock up your Windows 2000 machine so hard you had to powercycle (:argh:)

hackbunny fucked around with this message at 23:40 on Nov 26, 2013

Deus Rex
Mar 5, 2005

tef posted:

sorry i can't right now i'm about to teach rubyists how to fold origami in buenos aires

fold? I think you mean inject sir :q:

Notorious b.s.d.
Jan 25, 2003

by Reene

Suspicious Dish posted:

so notorious b.s.d i am not saying this to be funny or yospos-y as a joke. you are the worst poster in this thread. you have some really terrible opinions.

the beating heart of yospos is this ugly truth: none of it is ironic

ever

Notorious b.s.d.
Jan 25, 2003

by Reene

hackbunny posted:

to the best of my knowledge, Windows 9x was the only OS insane enough to support running on drivers meant for bootcode. it was in fact an explicitly supported scenario: when you booted in safe mode, you accessed the hard disk through the (slow as gently caress) BIOS int 13h interface

it's important to note that this is, technically, impossible: on x86 you can't call real-mode code from protected mode, the CPU doesn't support it. so what Microsoft did was overwrite the RAM shadow of the ROM with a trampoline, and then crash the CPU with a triple fault. the CPU reboots in real mode and resumes execution from the trampoline, which calls the real-mode code you wanted to call but couldn't. brought to you by the same guys who used the invalid opcode trap as a syscall instruction, and when prompted by Intel engineers about desired improvements, asked for faster bad opcode traps (it was the fastest trap available, and "<1 byte invalid opcode> <4 bytes function identifier>" can be trivially patched at runtime into "<call opcode> <offset to function>" for kernel-kernel calls. Windows 9x was insane)
more ownage posting from hack bunny

windows 95 was a breathtaking accomplishment. i'm not sure if it was a good intake of breath, but it will certainly make your audience gasp. a pre-emptive multitasking 32 bit extension to windows... that will also run real-mode apps through voodoo that required talking to intel engineers

i remember getting windows 95 on my home pc and being like YESSSS i am living in the future

then it crashed
that happened a lot because i had a 16 bit sound driver. whoops.

hackbunny posted:

Windows NT instead does it the "right" way, by executing BIOS code in a v86 VM and sloooowly emulating in software the missing opcodes (v86 emulates an 8086). and it's only used for VGA stuff like full-screen text mode. you can find the real-mode address space mapped at the bottom of csrss.exe's address space for that purpose. another fun VGA fact: graphical DOS applications running in full screen directly call into the VGA BIOS, and this is how SimCity 2000 for DOS could lock up your Windows 2000 machine so hard you had to powercycle (:argh:)

how did this work? like, how is it possible for a usermode app to invoke anything in the vga bios.

i think i fail to understand the kernel/user divide here. it has been made very clear to me that windows is not what i am used to

Adbot
ADBOT LOVES YOU

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Notorious b.s.d. posted:

the beating heart of yospos is this ugly truth: none of it is ironic

ever

how ironic

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply