|
For thread synchronization and for IPC. It's using message passing for that.
I could do Application.Run and then use WindowsFormsSynchronizationContext or whatever it is, but I'd rather not, as that's sloppy as hell.
Real programmers use butterflies
|
|
|
|
|
I assume you've looked at Topshelf[^], and the ActionThread class from Stephen Cleary's Nito.Asynchronous[^] library?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I haven't seen TopShelf but I have heard it mentioned before
The Nito.Asynchronous library I've looked at but while it's fascinating, i don't think it solves my problems with ServiceBase.Run()
What would be easy in an unmanaged service has become astoundingly difficult in .NET because of how they designed - in particular - ServiceBase.Run()
You know why I think they did it? It's easier for the beginners when your service doesn't exit at the end of your Main() function.
So my guess is Run() just blocks for that reason. It's ridiculous the idea that more advanced developers would have to suffer the limitations put in the framework for beginners. One of the reasons I liked .NET in first place is it doesn't "hide" anything. Everything is exposed if you know where to look. The training wheels are optional.
But ServiceBase.Run() seems to be a break from that pattern.
Edit: Oh no, I forgot about the Service Control Dispatcher thread that win32 needs to host services. Looks like Run() is being tied up there. That's at least reasonable, as I can shift that to any thread I want.
Real programmers use butterflies
modified 28-Jul-20 5:41am.
|
|
|
|
|
Message passing allows you to send something to another thread or perhaps process or machine(s), to be processed on the remote end.
Usually, you have a fixed number of "messages" that the other side understands, but what if you could send *code* in the stream, even across process or network?
Doing that would allow your service to be extensible by its clients. As the clients upgrade their capabilities the server follows suit, sometimes without changing it at all.
There are two problems with this - complexity and security.
There is a solution to both - something like a Pike VM like this Regex as a Tiny "Threaded" Virtual Machine[^]
Except with more than 7 or so instructions. It could be built up to be mini VM that understands say 20 different bytecode instructions. If you find that's eating up bandwidth add more instructions that do more complicated things, making them "chunkier", until the VM is mature. Once it gets there you can do like I said with the extensible service.
This is either the dumbest idea I've had in the past two weeks to the best. I'm still not sure. Maybe coffee will clear it up.
Real programmers use butterflies
|
|
|
|
|
Who's the "user"? Most can't formulate a SQL query. You'll wind up with "libraries" (somewhere) in any event.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
The client software would deal with the complexity. Most of the dev end would be on the client code, since the service itself can be extended. I wouldn't expect a user to ever touch the bytecode
Real programmers use butterflies
|
|
|
|
|
Quote: There are two problems with this - complexity security and security. FTFY
- I would love to change the world, but they won’t give me the source code.
|
|
|
|
|
With the VM you can give it access only to certain things. My memory is a managed byte array with clear bounds, my set of instructions are limited to the low level operations the server is capable of, so say you did this with a machine with like 4 tesla cards (or whatever they're calling them today), and the clients could offload rendering operations (not necessarily realtime, but quick)
then your client wants to be able to say, motion blur something. You could write the transform for that in the bytecode.
What instructions the VM takes depends on what the service does. But I don't think custom graphics filters for example, would pose much security risk. If all your instructions deal in math or pixels and polygons.
Real programmers use butterflies
|
|
|
|
|
The problem there is the same as most "exploits" on Windows (and other systems, including Linux based stand alone hardware): any tiny mistake can expose stuff you didn't expect to. Just think of the number of buffer overrun exploits you heard about a few years ago. Allowing "downloaded code" to run is always a security risk, even if you are pretty sure nothing can get outside the sandbox ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
You're not wrong
This is why we can't have nice things.
Real programmers use butterflies
|
|
|
|
|
Thomas Huxley: The great tragedy of science - the slaying of a beautiful hypothesis by an ugly fact.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Facts schmacts.
Believe what is beautiful, but check your work.
Real programmers use butterflies
|
|
|
|
|
You beat me to it
cheers
Chris Maunder
|
|
|
|
|
Your idea gave me an idea!
I can use the lounge for a reminder board and ToDo list.
Absolutely awesome! Thanks !
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
It wasn't really a todo. It was intended to start a discussion about an idea. It has. I'm sorry if you feel my message shouldn't have been posted.
Real programmers use butterflies
|
|
|
|
|
You have to lighten up in your interpretation, often ending up as self criticism.
I was just making a funny - I usually forget to click any of the radio buttons for a post.
It's the lounge. Relax. Take off your shoes.
Burp Phart Make yourself comfortable.
You're among friends, here.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
sorry, i've gotten a lot of crap about what I post from other commenters here. i guess i read your post in the wrong light.
Real programmers use butterflies
|
|
|
|
|
Oi! No pharting in the lounge please. That's what elevators are for.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Yeah. I know.
But how else can we tell you we like you so expressively?
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
You are so full of .... hot air
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
OK - it's time you're given the facts of life.
In this case, did you ever wonder why a phart stinks?
?
?
?
?
?
?
It's for the benefit of those who didn't hear it.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
It seems to me you are describing a stripped down version of sending something like java code somewhere to be executed on a virtual machine. To me, this raises the question of why bother stripping it down?
In other words, it seems like a bit of a twist on the HTML browser-server model.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
I guess it kind of is. After i wrote the post i thought about javascript, and extending a Javascript machine to run on the server, but i think other commenters have talked me down from the edge of this particular cliff.
Real programmers use butterflies
|
|
|
|
|
honey the codewitch wrote: Usually, you have a fixed number of "messages" that the other side understands, but what if you could send code in the stream, even across process or network?
The first thought that crossed my mind when I read this was "ActiveX".
I'll leave it at that.
|
|
|
|
|
:shudder:
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|