Omnifarious is currently certified at Journeyer level.

Name: Eric Hopper
Member since: 2000-12-18 11:34:17
Last Login: 2012-03-21 12:17:49

FOAF RDF Share This

Homepage: http://www.omnifarious.org/~hopper/

Notes:

I've been a C/C++ programmer for a long time. I've also been working on The StreamModule System for a long time. I've written one commercial application using it and numerous small test programs, including a port forwarder.

I also write small papers and essays on technical topics when the whim strikes me.

In an effort to get google to consolidate my online identity, here is a link to my ClaimID page: Eric Hopper' ClaimID

I'm currently looking for a job. So if you need a C++ or Python programmer who also knows a bunch about Linux, Unix, IPv6 and cryptography, please head over to my resume.

Interesting Advogato links:

Projects

Articles Posted by Omnifarious

Recent blog entries by Omnifarious

Syndication: RSS 2.0

IPv6 not the peer connectivity panacea that people think

IPv6 is supposed to solve all of the peer connectivity issues introduced by NAT. And, on the surface, it seems to do just that by making it possible to assign a unique, globally routable IP address to every conceivable device that could possibly want one.

But this doesn't really solve the problem of peer connectivity.

My cell phone, for example, may be assigned an address by my carrier. But my carrier may be unwilling to let me have any more addresses. This means that any devices I want to connect to the Internet through my cell phone will not be able to have globally routable addresses because my ISP/cell carrier won't route them. And, of course, under IPv6, nobody is ever supposed to do NAT.

So, peer connectivity is still restrained by network topology. The power to decide who gets to be a router decides what gets to connect. And this is broken.

IMHO, the solution is to have addresses assigned to things that have nothing to do with routing, and allow a routing layer on top of the network layer that can route things to those addresses regardless of the actual topology of the network. Tor is an example of this sort of thing. Tor is basically a routing layer on top of TCP/IP that's designed to obscure which routes any given piece of information takes.

But Tor is a specific example of a larger issue. Routing cannot be left ultimately controlled by anybody except network end-points. Such creates failure modes both physical and political that are significantly less than the best we can do.

Which is one of the biggest advantages to a protocol like CAKE. :-) It divorces routing from addressing and expects end-nodes to have a hand in making routing decisions.



comment count unavailable comments

Syndicated 2012-03-13 16:10:08 from Lover of ideas

'Religious' issue

Today, a comment I got really rankled me. My affection and desire for technologies that are not freedom hostile was called a 'religious issue'. This trivializes my desire, and makes it seem like someone has to 'drink the kool-aid' to think the issue is real. And that's insulting.

I find this particularly upsetting given how many people rallied to defeat SOPA. Do people not understand the end goal here? Do you really want your technologies to decide for you which websites you're allowed to see, what you can read, what you can hear? Because ignoring freedom when making technology choices is marching down that very road.

Oh, those companies, they'll never do that. But, they will. Maybe they don't even realize they will. But that kind of lockdown and control is so very economically attractive that companies will march there inexorably unless it's clear that's not a direction we want to go in.

And your choices affect me. Whenever you make a choice against freedom, you're affecting my ability to make that choice. It is possible to make technology that works and is convenient, but doesn't rob you of your freedom. But every time you vote with your dollars against such technology, every time you decide this feature or that feature is worth giving up some of your freedom, you're encouraging companies to dangle shiny toys in exchange for your freedom. In fact, you're encouraging them to only provide the shiny toys if you (and I) give up our freedom to get them. It's like giving in to a toddler who throws tantrums.

I recognize that different people make different choices for their own reasons. And I'm fine with them making those choices. But I will not pass up any opportunity to inform them of the effect of their choice on themselves, and on me.



comment count unavailable comments

Syndicated 2012-03-09 20:10:21 from Lover of ideas

Working on a small library, what should I name it?

I'm working on a small library to express computations in terms of composable trees of dependencies. These dependencies can cross thread boundaries allowing one thread to depend on a result generated in another thread. This is sort of a riff on the whole promise and future concept, but the idea is that you have chains of these with a potential fanout in the chain greater than 1. Kind of like the venerable make utility in which you express what things need to be finished before starting on the particular thing you're talking about.

But I'm not sure what I should call it. Maybe Teleo because it encourages to express your program in terms of a teleology.

I'm writing this basically because I've encountered the same problem on at least two different projects now, and it occurs to me that it would be really good to have a well-defined standard way of launching things in other threads and waiting for the results that suggested an overall program architecture. The projects I worked on were all set to develop a huge mishmash of different techniques that wouldn't necessarily play well together or be easy to debug.



comment count unavailable comments

Syndicated 2011-11-08 22:13:54 (Updated 2011-11-09 03:03:29) from Lover of ideas

Architecture problem...

I used to have a really good idea of what the architecture of a system that had to respond to multiple different possible sources of input or other reasons to do things (such as some interval of time expiring). My idea was basically to make everything purely event-driven and have big event loops at the heart of the program that dispatched events and got things done.

This solves the vexing problem of how to deal with all these asynchronous occurrences without incurring excessively complex synchronization logic. Nothing gives up control to process another event until the data structures its working with are in a consistent state.

But there are two problems with this model. One is old, and one is relatively new.

The old problem is that such event-driven systems typically exhibit inversion of control, and that makes them confusing and hard to follow. There are ways to structure your program to give people a lot of hints as to what's supposed to happen next when you give up control in the middle of an important operation only to recapture it again at some later point in time in a completely different function. But it's still not the easiest thing in the world to follow.

The 'new' problem is that silicon-based CPUs have not been getting especially faster recently. They've instead been getting more numerous. This is a fairly predictable result. CPUs have a clock. This clock needs to stay synchronized across the entire CPU. Once clock speeds exceed a certain frequency, the clock signal takes longer to propagate across the entire chip than the amount of time before the next pulse is supposed to happen. This means that in order to have an effectively faster CPU on a single chip you need to break it up into independent units that do not need to be strictly synchronized with each other. It's a state horizon problem.

But most programs are not designed to take advantage of several CPUs. If you want a program that's a cohesive whole, but still gets faster as the hardware advances, you need to break it up into several threads.

It seems like maybe it would be simple to do this with a program that had multiple threads. You just have multiple event loops. But then you end up with several interesting problems. How do you decide what things happen in which event loop? What happens if you need to have data shared between things running on different event loops? You run the risk of re-introducing the synchronization issues you avoided when you added the event loops in the first place, all with the cost of inversion of control. It doesn't seem worth it.

Additionally, if you have inter-thread synchronization, what happens if it takes awhile for the other thread to free up the resource you need? How do you prevent deadlocks? Most event systems do allow you to treat the release of a mutex or a semaphore as an event, so you can't just fold waiting for the mutex back into the system as just another event without doing some trick like spawning a thread that waits for the mutex and writes into some sort of IPC mechanism once it's acquired.

And splitting up your program into multiple event threads is not trivial either. How do you detect and prevent the case of one thread being overworked? Also, there is 'state kiting' to consider. Preferably you would prefer one CPU to be handling the same modifiable state for long periods of time. You want to avoid situations where first one CPU cache, then the next have to load up the contents of a particular memory region. Typically, each core will have its own cache. If for no reason other than efficient use of space, it would be good if each core had a disjoint set of memory locations in cache. And to avoid the latency of main memory access, it would be good if that set was relatively static. This means that a single event loop should be working with a fairly small and unchanging set of memory locations.

So simply having several threads, each with its own event loop seems a solution fraught with peril, and it seems like you're throwing away a lot of the advantages you went to an event driven system (with the unpleasant inversion of control side-effect) for in the first place.

So the original idea needs modification, or perhaps a completely new idea is needed.

One modification is embodied in the language Erlang. Erlang still has an event loop and inversion of control. You waiting for messages that come in on a queue. Any other loop can add messages to any queue it knows about. These messages are roughly analogous to events. But the messages themselves convey only information that is immutable. Since it is immutable, shared or not, no synchronization is required since it cannot change.

Erlang also encourages the creation of many such event loops, each of which does a very small job. Hopefully, no individual loop is too overloaded. Modern operating systems are adept at scheduling many jobs, and so this offloads the scheduling of all of these small tasks onto the OS.

I do not think Erlang does overly much to solve the locality of reference problem.

Another approach is the approach taken by the E programming language. It makes extensive use of a concept called a 'future' or 'promise'. This is a promise to deliver the result of some operation at some future point in time. It allows these promises to be chained, so you can build up an elaborate structure of dependencies between promises. In a sense, the programming language handles the inversion of control for you. You specify the program as if control flow were normal, but the language environment automatically launches as many concurrent requests as possible and suspends execution until the results are available.

It is possible to build a set of library-level tools in C++11 to implement this kind of thing somewhat transparently in that language.

I am unsure if there are any major tradeoffs in this approach. Certainly in C++ there is a great deal of implementation complexity, and that complexity cannot be completely hidden from the user as it is in E. I wonder if that implementation complexity introduces unacceptable overhead.

I also suspect that it may be difficult to debug programs that use this sort of a model. They appear to execute sequentially, but in truth they do not. It is possible, for example, to have two outstanding promises for bytes from a file descriptor, but which order those promises will be fulfilled in will not be readily apparent from reading the code. And error conditions can crop up at strange times and propagate to non-obvious places in the control flow of your program.

I also suspect this model will not exhibit the best locality of reference semantics. There will be a tendency to frequently spawn and join threads to handle asynchronous requests. And it will not be immediately apparent to the OS CPU scheduler which threads need to work with which memory objects. And this may lead to active state kiting between CPUs.

Also, those calls to create and destroy threads have a cost, even if that cost is fairly small, it's still likely much more expensive than acquiring an unowned mutex, and probably even more expensive than the call to wait for a file descriptor readability event or waiting for a briefly held mutex to become available.

Of course, it may be possible to implement all of this without creating many threads given a sufficiently clever runtime environment that implements its own queue that folds IO state and semaphore/mutex state events into a single queue. Such an environment would still need a lot of help from the application programmer though to divide up the application to maximize locality of reference within a single thread.

This is a fairly long ramble, and I'm still not really sure what the best approach is. I think I may try to set up some kind of 'smart queue'. This queue will have a priority queue of runnable tasks, and a queue of tasks that could potentially execute given a set of conditions. When a condition is met, the queue will be informed, and if that conditions enables one or more tasks to be run, these tasks will be added to the priority queue.

I envision that the primary thing on which the priority queue will be prioritized is length of time since the task was added to the 'wait for condition' list.

I can then write a C++11 library that will allow you to automatically turn any function that returns a promise into a function that uses these conditions to split up its execution. At least, if you use sufficient care in writing the function.

The conditions (since fulfilling a promise will be a possible condition) will have data associated with them. If this data involves shared mutable state, that will require a great deal of extra care.



comment count unavailable comments

Syndicated 2011-10-20 22:43:44 from Lover of ideas

Digital signatures and documents

Documents and the digital signatures that apply to them are necessarily separate. Most current cryptographic systems either digitally sign things on the fly (TLS) or send a library of digital signatures with the document they sign (OpenPGP). Though, to be fair, in the OpenPGP case, each of those digital signatures signs a variant document.

In CAKE there are documents to be signed. Examples are documents that say "This public key exists, was created at time X, is valid for new sessions and signatures from times A through B, and is considered invalid at time E.", or "This public key is reachable at this URL from times A through B.", or "Public key I has agreed to store and forward messages for public key J from times A through B.", or "My name for public key J is N.".

For some of these documents there is only one key who's signature is relevant. For others, a specific small set of keys is relevant (the store and forward case, for example). And for others you care about all signatures, but especially signatures by other keys you trust.

Of course, you could consider the document signed to include the name of the signing entity, in which case, each signature would be for a different document.

I'm not completely sure how to handle this. In my system there will be some documents that cannot be considered valid until multiple signatures have been received. So the signature has to be totally detached from the document.

Syndicated 2011-06-24 05:43:36 from Lover of ideas

153 older entries...

 

Omnifarious certified others as follows:

  • Omnifarious certified Omnifarious as Journeyer
  • Omnifarious certified Fefe as Journeyer
  • Omnifarious certified itamar as Journeyer
  • Omnifarious certified jaded as Apprentice
  • Omnifarious certified ali as Apprentice
  • Omnifarious certified sah as Apprentice
  • Omnifarious certified lerdsuwa as Journeyer
  • Omnifarious certified hacker as Master
  • Omnifarious certified kenelson as Journeyer
  • Omnifarious certified goingware as Journeyer
  • Omnifarious certified ModernRonin as Apprentice
  • Omnifarious certified hanksdc as Apprentice
  • Omnifarious certified Sarah as Apprentice
  • Omnifarious certified mjs as Master
  • Omnifarious certified dan as Journeyer
  • Omnifarious certified mobius as Apprentice
  • Omnifarious certified wsanchez as Master
  • Omnifarious certified sye as Journeyer
  • Omnifarious certified davewiner as Master
  • Omnifarious certified Xorian as Journeyer
  • Omnifarious certified xach as Journeyer
  • Omnifarious certified sgithens as Apprentice
  • Omnifarious certified mathgenius as Apprentice
  • Omnifarious certified xiphmont as Master
  • Omnifarious certified shlomif as Journeyer
  • Omnifarious certified alan as Master
  • Omnifarious certified gstein as Master
  • Omnifarious certified andrei as Journeyer
  • Omnifarious certified jbucata as Apprentice
  • Omnifarious certified usmile1 as Apprentice
  • Omnifarious certified jhyde as Journeyer
  • Omnifarious certified rachel as Apprentice
  • Omnifarious certified jdub as Master
  • Omnifarious certified Bram as Master
  • Omnifarious certified glyph as Journeyer
  • Omnifarious certified ask as Master
  • Omnifarious certified kwoo as Apprentice
  • Omnifarious certified RichardA as Apprentice
  • Omnifarious certified werner as Master
  • Omnifarious certified gary as Journeyer
  • Omnifarious certified Akira as Journeyer
  • Omnifarious certified ebf as Journeyer
  • Omnifarious certified mitnick as Apprentice
  • Omnifarious certified mdupont as Journeyer
  • Omnifarious certified domi as Apprentice
  • Omnifarious certified MisterP as Apprentice
  • Omnifarious certified connolly as Journeyer
  • Omnifarious certified MichaelCrawford as Journeyer
  • Omnifarious certified SIrabbi as Master
  • Omnifarious certified gobry as Journeyer
  • Omnifarious certified Zooko as Master
  • Omnifarious certified kvaneesh as Apprentice
  • Omnifarious certified dlecorfec as Journeyer
  • Omnifarious certified jds as Journeyer
  • Omnifarious certified brouhaha as Journeyer
  • Omnifarious certified jibbler as Apprentice
  • Omnifarious certified yeupou as Journeyer
  • Omnifarious certified kjwoo as Apprentice
  • Omnifarious certified ncm as Master
  • Omnifarious certified titus as Journeyer
  • Omnifarious certified pphaneuf as Master
  • Omnifarious certified kjw as Journeyer
  • Omnifarious certified parkerc as Journeyer
  • Omnifarious certified leio as Journeyer
  • Omnifarious certified oubiwann as Master
  • Omnifarious certified frehberg as Journeyer
  • Omnifarious certified elanthis as Journeyer
  • Omnifarious certified fallenlord as Journeyer
  • Omnifarious certified lllmanulll as Apprentice
  • Omnifarious certified cinamod as Master
  • Omnifarious certified jpick as Master
  • Omnifarious certified Burgundavia as Apprentice
  • Omnifarious certified orique as Apprentice
  • Omnifarious certified jgw as Apprentice
  • Omnifarious certified MarkAtwood as Journeyer
  • Omnifarious certified sfllaw as Journeyer
  • Omnifarious certified sussman as Master
  • Omnifarious certified slamb as Journeyer
  • Omnifarious certified helmut as Journeyer
  • Omnifarious certified mitsue as Apprentice
  • Omnifarious certified apenwarr as Master
  • Omnifarious certified obiltschnig as Apprentice
  • Omnifarious certified tonyyarusso as Apprentice
  • Omnifarious certified robogato as Master
  • Omnifarious certified StevenRainwater as Journeyer
  • Omnifarious certified ciphergoth as Journeyer
  • Omnifarious certified pesco as Apprentice
  • Omnifarious certified avassalotti as Apprentice
  • Omnifarious certified laburu as Apprentice
  • Omnifarious certified bradfitz as Master
  • Omnifarious certified bcully as Journeyer

Others have certified Omnifarious as follows:

  • Omnifarious certified Omnifarious as Journeyer
  • lerdsuwa certified Omnifarious as Journeyer
  • jaded certified Omnifarious as Journeyer
  • goingware certified Omnifarious as Journeyer
  • ali certified Omnifarious as Journeyer
  • dan certified Omnifarious as Journeyer
  • pphaneuf certified Omnifarious as Journeyer
  • stone certified Omnifarious as Journeyer
  • andrei certified Omnifarious as Journeyer
  • sye certified Omnifarious as Master
  • ebf certified Omnifarious as Journeyer
  • mdupont certified Omnifarious as Journeyer
  • domi certified Omnifarious as Journeyer
  • gobry certified Omnifarious as Journeyer
  • SIrabbi certified Omnifarious as Journeyer
  • brouhaha certified Omnifarious as Journeyer
  • kjwoo certified Omnifarious as Journeyer
  • ncm certified Omnifarious as Journeyer
  • kjw certified Omnifarious as Journeyer
  • mitsue certified Omnifarious as Journeyer
  • aratype26 certified Omnifarious as Master
  • helmut certified Omnifarious as Journeyer
  • bcully certified Omnifarious as Journeyer
  • jcolinzheng certified Omnifarious as Journeyer
  • murajov certified Omnifarious as Journeyer

[ Certification disabled because you're not logged in. ]

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!

X
Share this page