MOJO

298 views
Skip to first unread message

Shivam Shahi

unread,
Apr 15, 2022, 9:43:26 PM4/15/22
to Chromium-dev
Hey, I was beginning  to study MOJO and was wondering why they do not use traditional IPC like shared memory or named pipe, what makes MOJO so different?

Min Qin

unread,
Apr 16, 2022, 12:34:12 AM4/16/22
to shiv...@qikfox.com, Chromium-dev

On Fri, Apr 15, 2022 at 6:42 PM Shivam Shahi <shiv...@qikfox.com> wrote:
Hey, I was beginning  to study MOJO and was wondering why they do not use traditional IPC like shared memory or named pipe, what makes MOJO so different?

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/8eb529fa-9228-42cb-b2e4-f5d66c5e2f10n%40chromium.org.

Chris Hamilton

unread,
Apr 20, 2022, 10:39:46 AM4/20/22
to qin...@chromium.org, shiv...@qikfox.com, Chromium-dev
Mojo is mostly an abstraction layer on top of per-platform IPC mechanisms. In fact, it can be implemented using pipes, sockets, shared memory, whatever you want, and be different on each platform. The main thing that Mojo provides is a Chrome-friendly cross-platform "Interface Description Language" (IDL), with bindings for each of Chrome's languages (C++, Java, Javascript) and native data types (we actually have two variants of C++ native types, one for Blink code and another for non-Blinkcode). There are a lot of docs in the source code that document what Mojo is and how it works, with this one being a good starting point.

Cheers,

Chris

Ken Rockot

unread,
Apr 20, 2022, 12:01:29 PM4/20/22
to chr...@chromium.org, qin...@chromium.org, shiv...@qikfox.com, Chromium-dev
The other major feature Mojo exposes is routing. Some systems enforce resource limits which would prevent us from creating the huge number of transferable IPC endpoints (for object remoting) we'd like to use in Chrome. If you tried to replace Mojo message pipes 1:1 with Linux sockets, for example, Chrome would run out of file descriptors almost immediately.

Mojo supports a huge number of endpoints by multiplexing and abstracting away those platform-specific resources like sockets; and because it must also support arbitrary, low-latency, asynchronous transfer of its endpoints, such multiplexing work requires a significant degree of complexity to manage efficient packet queuing and routing behind the scenes.

Reply all
Reply to author
Forward
0 new messages