Code Monkey home page Code Monkey logo

revolving-doors's Introduction

Evangelical UNIX street preacher. Dennis Ritchie died for your sins. He/Him.

revolving-doors's People

Contributors

jack-morrison avatar robertdfrench avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

revolving-doors's Issues

port Makefiles to illumos make

The Makefiles all use GNU conventions, but don't have to. Porting them to illumos' make would allow the more natural make test syntax to work as expected. At the moment, if someone tries to do this (instead of gmake test), they get cryptic errors when illumos fails to parse GNU syntax.

Prefer open over stat+creat

Per u/jking13:

doing the stat(2) + creat(2) still leaves a window for something else to create the file between the two calls (and could potentially be a security issue) open(path, O_RDWR|O_CREAT|O_EXCL, mode) to create the path would be preferred -- it will fail if the path already exists.

Emphasize that door performance derives from scheduling

As u/jking13 puts it:

The other bit that might be worth mentioning is that the advantage of a door vs. say a unix socket is that during a door call, the scheduler directly transfers control to the server thread -- so there is a very minimal scheduler overhead compared to other forms of IPC. There's a bit more to it, but probably a bit much for a tutorial.

It would be good to nail down the language as precisely as possible here. Is this the same as bypassing the scheduler? Do we avoid a context switch? Are we guaranteed that the server thread shares the same cpu timeslice as the client thread? Is it appropriate to make a comparison to cooperative scheduling, or has that got different implications

Set up a sockets demo for contrast

For #12, we need to show that rpc calls have more latency with sockets than with doors. For #11 we need to show that you can pass a descriptor with the sockets library. Thus, we need an alternate implementation of some of these demos using sockets.

Adjust door message size with door_setparam

From u/jking13:

The door_getparam(3C) and door_setparam(3C) can be used to adjust the parameters (including the max message size). I suspect the limit you might be hitting on SmartOS could be related to the resource sizing of the zone -- since some of the results may end up having to use mmap, I believe that can also be a factor.

Would be interesting to compare the defaults on each system, or maybe even use door_setparam in the tutorial to make them equal, so that the message transfer lessons do not have to talk about message size in the abstract.

What controls the maximum door argument size?

On my SmartOS zone, I seem to be able to send door payloads that are about twice as big as I can on my VM running OpenIndiana. What is the difference?

  • Configuration of the host?
  • Hardcoded kernel parameters?
  • Default ulimits?

I suspect this has something to do with stack size, but I am not quite sure what.

18_backgrounding_processes/server.c has door routines from next step

Looks like in server.c for step 1.8 (18?) has the server.c from step 2 (20?). This preemptively introduces some door specific code before explaining it. That step effectively introduces 2 new topics, of which only 1 is explained. Just a minor detail, and probably not an issue. Just something i noticed!

This tutorial is fantastic btw ๐Ÿ‘

Add Check for Understanding on A0_result_parameters

This is where we go over the data structures and conventions used for packing / unpacking arguments to / from door_calls, but there are no "Check for Understanding" questions at the bottom. It's a critical point for anyone wanting to work with the Doors API, so it's worth providing folks a way to convince themselves that they know what's going on. AND! Some of these structures are kindof subtle if you don't spend the majority of your time in C.

Why do we pass a pointer to the door argument?

We call

door_call(door, &args);

but why? Can the server process modify args? I suspect that if the server returns fewer bytes than expected, the client will want to know, but can any other fields be modified?

Prefer err.h family of functions over perror+exit

Per u/jking13:

Also illumos (note: it is supposed to intentionally be lowercase, don't ask me why), supports the BSD-style err(), errx(), etc functions via the inclusion of err.h. That could simplify all those perror(...); exit(1) bits. Not necessary, but can be nice.

Improve mobile navigation

Github's table of contents is not rendered by default on mobile. You have to click the "show code" button. This is not necessarily an obvious place to hide the content, from the reader's point of view.

Have setup guides create an unprivileged user

In order to emphasize privilege separation, we actually need some of the processes to run as a different user. The setup guides should create one or more unprivileged users for the sake of demonstrating this feature.

Write SmartOS setup guide

At least navigate folks through setting up a SmartOS zone on Joyent and connecting to it, and setting up gcc. That ain't obvious.

Clarify that door passing is a special case of descriptor passing

From u/jking13:

When you talk about passing a door through a door, it might be good to note that you're just using the feature that allows doors to pass file descriptors, just the descriptor in that case happens to be a door -- it could be a file, a socket, a pipe, etc.

This begs the question of whether there are other general means for passing descriptors to another process, and whether one could pass a door descriptor using those. If so it would be good to have a contrasting example so that I do not paint doors as more special than they really are.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.