Before I address this question I want to be sure that we have the same
understanding of how Electron works at a low level. Electron is a single
process with a single thread. It contains two separate sets of JavaScript
execution state. One is a Chromium environment that is called the "renderer
process", and the other is a Node environment that is called the "main
process". These are correspondingly backed by a Chromium event loop and a
Node event loop, which the single real process executes in alternation. The
IPC system is really just an in-process message passing system for moving
data between those two JS execution environments.

It is true that either part of the process can bottleneck the other,
because this is a cooperative multitasking environment. The best way to
avoid blocking the UI when you need to do something computationally
expensive is to break it down into steps and perform the steps
asynchronously, to give the UI event loop a chance to run.

Given that information, gRPC does not seem to solve most of those problems.
You could use it to offload computationally expensive work to somewhere
else, like with any other client/server setup.

On Fri, Sep 7, 2018 at 6:56 AM Kevin Burton <burtona...@gmail.com> wrote:

> So I think grpc could be used to help out with a major issue for Electron
> apps.
>
> Essentially the main process can be a bottleneck around the UI thread.
> You basically don't want to lock it up as the IPC can't be used to control
> the browser process.
>
> Additionally, there's the issue of blocking the UI thread with
> computationally complex activities.
>
> On top of that there's an issue of needing a centralized coordinator for
> some activities like locking, updating files on disk , etc.
>
> We could use grpc to solve these problems I think.
>
> The grpc daemon could sit outside the main electron and render processes
> and allow all components to talk to each other and discover each other.
>
> It *looks* like grpc-web could solve this but I'm unclear if it works in
> the renderer process.
>
> This would save me a huge amount of time if it were possible to get to
> work within Electron.
>
> Thoughts?
>
> --
> You received this message because you are subscribed to the Google Groups "
> grpc.io" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to grpc-io+unsubscr...@googlegroups.com.
> To post to this group, send email to grpc-io@googlegroups.com.
> Visit this group at https://groups.google.com/group/grpc-io.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/grpc-io/7ebd434a-d64d-4600-a04f-a1de28dd4407%40googlegroups.com
> <https://groups.google.com/d/msgid/grpc-io/7ebd434a-d64d-4600-a04f-a1de28dd4407%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To post to this group, send email to grpc-io@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/CAPK2-4ehbMywYkA-_%3DVQUmpv3dZyfgGM4tgFdJ6408kEz_sf3g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to