Asynchronous waaahh???
-
Truly not interested in it. Is it time-sharing one thread in the engine? Or does each process get one thread in the engine? Unsure that the terms "blocking" and "non-blocking" truly apply to the situation.
PIEBALDconsult wrote:
Truly not interested in it.
:laugh:
PIEBALDconsult wrote:
Is it time-sharing one thread in the engine? Or does each process get one thread in the engine?
If I were to give it an oversimplification, the time sharing analogy fits perfectly. It's all in one thing, but no one particular bit of code will block the app in the traditional since, since they all get their orders from the event loop. Now, all of this is under the hood of course, and most peeps will never notice what's going on.
PIEBALDconsult wrote:
Unsure that the terms "blocking" and "non-blocking" truly apply to the situation.
Fair enough. When I say non-blocking, I mean something along the lines of this:
JavaScript is also known for it’s non-blocking behavior. Non-blocking means that JavaScript doesn’t wait for the response of an API call, an Ajax request, an I/O event or a timer but moves on with the other block of code below it.
Stuff like methods, etc. can block execution, but a lot of peeps opted for routines that do not block and that's where callback hell came from. The event loop made this a breeze to deal with because of the way it scheduled execution and returns. So, I kinda just lump sum crap when I talk about it these days. Old age stuff. :laugh:
Jeremy Falcon
-
Jeremy Falcon wrote:
never a good idea to look up a computer more than a second or so.
Bullpuckey. Ctrl-C kills most console utilities anyway. Not a problem.
Gotta disagree there, it sends a signal like [SIGINT](https://www.gnu.org/software/libc/manual/html\_node/Termination-Signals.html) which can totally be ignored if a program hangs. I've had way more than one app just tell me "whatever bro" after smashing Ctrl+C over and over.
Jeremy Falcon
-
PIEBALDconsult wrote:
Truly not interested in it.
:laugh:
PIEBALDconsult wrote:
Is it time-sharing one thread in the engine? Or does each process get one thread in the engine?
If I were to give it an oversimplification, the time sharing analogy fits perfectly. It's all in one thing, but no one particular bit of code will block the app in the traditional since, since they all get their orders from the event loop. Now, all of this is under the hood of course, and most peeps will never notice what's going on.
PIEBALDconsult wrote:
Unsure that the terms "blocking" and "non-blocking" truly apply to the situation.
Fair enough. When I say non-blocking, I mean something along the lines of this:
JavaScript is also known for it’s non-blocking behavior. Non-blocking means that JavaScript doesn’t wait for the response of an API call, an Ajax request, an I/O event or a timer but moves on with the other block of code below it.
Stuff like methods, etc. can block execution, but a lot of peeps opted for routines that do not block and that's where callback hell came from. The event loop made this a breeze to deal with because of the way it scheduled execution and returns. So, I kinda just lump sum crap when I talk about it these days. Old age stuff. :laugh:
Jeremy Falcon
OK. Seems OK given the language's primary usage. But backward for general purpose development. We (many of us) keep asking for more and more cores and hyperthreading so we don't have to share a thread. From my point-of-view, the caller should be able to request blocking or non-blocking behavior as appropriate for the current task. If I have to wait for an asynchronous call to complete anyway, then why bother going through all that trouble. </rhetorical> I would much rather spin up a thread on my side as needed. It seems you don't have that luxury.
-
OK. Seems OK given the language's primary usage. But backward for general purpose development. We (many of us) keep asking for more and more cores and hyperthreading so we don't have to share a thread. From my point-of-view, the caller should be able to request blocking or non-blocking behavior as appropriate for the current task. If I have to wait for an asynchronous call to complete anyway, then why bother going through all that trouble. </rhetorical> I would much rather spin up a thread on my side as needed. It seems you don't have that luxury.
For sure, but it's just a different way of thinking. Personally, I like both models and think JS (despite its beginnings) has come a long way and does some really interesting stuff.
Jeremy Falcon
-
Gotta disagree there, it sends a signal like [SIGINT](https://www.gnu.org/software/libc/manual/html\_node/Termination-Signals.html) which can totally be ignored if a program hangs. I've had way more than one app just tell me "whatever bro" after smashing Ctrl+C over and over.
Jeremy Falcon
Never, not once. But then again, I don't write utilities which hang. And Ctrl-Z on OpenVMS.
-
Never, not once. But then again, I don't write utilities which hang. And Ctrl-Z on OpenVMS.
I dunno what apps you've used, but clearly we've used different ones. Either way, looks like we're gonna disagree on whether or not some things should be non-blocking. I still still think non-blocking is cool and the way to go, if possible. Oh the upside, it's Saturday and there's ice cream to be had. :laugh:
Jeremy Falcon
-
I dunno what apps you've used, but clearly we've used different ones. Either way, looks like we're gonna disagree on whether or not some things should be non-blocking. I still still think non-blocking is cool and the way to go, if possible. Oh the upside, it's Saturday and there's ice cream to be had. :laugh:
Jeremy Falcon
It certainly has its uses, but that doesn't mean that it should be forced on everyone all the time. Use it when it makes sense, same with everything. Something to bear in mind is whether or not you have anything else to do while you wait. If not, you're still just waiting. Or, in a real language, I can spin up a thread and do other things in my process, zing bang Bob's your mascot.
-
It certainly has its uses, but that doesn't mean that it should be forced on everyone all the time. Use it when it makes sense, same with everything. Something to bear in mind is whether or not you have anything else to do while you wait. If not, you're still just waiting. Or, in a real language, I can spin up a thread and do other things in my process, zing bang Bob's your mascot.
PIEBALDconsult wrote:
Something to bear in mind is whether or not you have anything else to do while you wait. If not, you're still just waiting.
I'm trying to end this discussion because it's going nowhere man. I've already mentioned there is always something to do, like respond to user input or signals. It's clear you have zero desire to agree with me, so not sure why we be dragging this out man. If you need to read a 1 byte file that's guaranteed to be small, cool... assuming it's local and not network attached. I'm referring to long operations. Not sure why this needs to be dragged out.
Jeremy Falcon
-
PIEBALDconsult wrote:
Something to bear in mind is whether or not you have anything else to do while you wait. If not, you're still just waiting.
I'm trying to end this discussion because it's going nowhere man. I've already mentioned there is always something to do, like respond to user input or signals. It's clear you have zero desire to agree with me, so not sure why we be dragging this out man. If you need to read a 1 byte file that's guaranteed to be small, cool... assuming it's local and not network attached. I'm referring to long operations. Not sure why this needs to be dragged out.
Jeremy Falcon
Again, I write mostly back-end stuff, there's no user input or anything. A long-running task is still going to take a while. Querying a database for some data and writing it to a file of some sort could take minutes or longer no matter what. And I can use a different process to do something else at the same time. Or spin up multiple threads in one process to write multiple files, no big deal. That's my bread and butter. Other languages can support other needs.
-
Again, I write mostly back-end stuff, there's no user input or anything. A long-running task is still going to take a while. Querying a database for some data and writing it to a file of some sort could take minutes or longer no matter what. And I can use a different process to do something else at the same time. Or spin up multiple threads in one process to write multiple files, no big deal. That's my bread and butter. Other languages can support other needs.
A user can be a script. Clearly, you just don't wanna agree man. :laugh: But hey... ice cream.
Jeremy Falcon