Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | cri@tiac.net (Richard Harter) |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: What is the right way to do this simple thing |
| Date | 2012-03-15 21:55 +0000 |
| Message-ID | <4f6209af.3709095@text.giganews.com> (permalink) |
| References | (1 earlier) <kfnlin8nllo.fsf@x-alumni2.alumni.caltech.edu> <4f5bfbf1.1966898545@text.giganews.com> <kfn4ntuonah.fsf@x-alumni2.alumni.caltech.edu> <4f5fc1a2.2214125669@text.giganews.com> <kfnk42mlufe.fsf@x-alumni2.alumni.caltech.edu> |
On Wed, 14 Mar 2012 14:55:01 -0700, Tim Rentsch
<txr@alumni.caltech.edu> wrote:
>cri@tiac.net (Richard Harter) writes:
>
>> On Sun, 11 Mar 2012 14:11:50 -0700, Tim Rentsch
>> <txr@alumni.caltech.edu> wrote:
>>
>>>cri@tiac.net (Richard Harter) writes:
>>>
>>>> On Sat, 10 Mar 2012 14:21:23 -0800, Tim Rentsch
>>>> <txr@alumni.caltech.edu> wrote:
>>>>
>>>>>cri@tiac.net (Richard Harter) writes:
>>
>> [snip lots of good stuff]
>>
>> Basically what you seem to be saying is to use an appropriate power of
>> two to force alignment. Sounds good to me, but it's not quite squeaky
>> clean bullet proof. Just a crochet.
>
>In that case I would want to ask for a more complete description
>of what constitutes, using your phrase, a squeaky clean bullet
>proof solution. An arbitrarily perverse implementation can
>screw up basically any scheme imaginable for this problem. What
>simplifying assumptions are you willing to grant about the
>various implementations involved, or what parts of the language
>can be excluded (one of those is not having pointers in the data
>area; what others)? If there aren't any then I think the
>problem is pretty much intractable.
Agreed that the general problem is intractable. Here is some
background.
The relevant context is a message passing system written in C.
Messages are passed between "mini-processes" which behave as though
they were processes (suspend/resume logic, input ports and output
ports, etc). The architecture is
Mini-processes run within process managers
Multiple process managers can run within a single OS thread.
Process managers can run in different OS threads.
Process managers can run on multiple networked processers.
Process managers can run on processors connected by the internet.
Key facts are: Process managers are single threaded; they are
(supposed to be) fast. Mini-processes are light-weight, processing
isn't much heavier than function calls. Mini-processes don't know
where data comes from or where it goes.
One of the issues in these kind of systems is what the inputs look
like. In shell programming the input ('the' is a problem in shell
programming) is in the form of a stream of characters. In Erlang it
is in the form of a list.
In this system inputs and outputs are typed. Moreover inputs to a
mini-process DO NOT HAVE TO BE DECODED. They can be used much as
though they were arguments to a function. Similarly outputs do not
have to be encoded.
Clearly, we can move data as is between the mini-processes running
under a single process manager. Similarly we should be able to move
data as is from one OS-thread to another in a single processor. After
that it gets a little fuzzy.
Connecting process managers requires the cooperation of magic network
software. The magic network software is in charge of moving messages
from one process manager to another. It decides whether the data must
be serialized and deserialized using something JSON. (Actually it
tells the process managers to do it.) Don't ask about addressing.
You really don't want to know.
So it comes down to this. We want a solid data format that is usable
within process managers. We would like it to be usable between
process managers if the connection are otherwise lightware and they
are consistent implementations. Otherwise we serialize. (And
lesnerize.) However that decision is left to matic network manager.
All clear? If, not I have more mud.
>
>Related to that, unless I am misunderstanding something, there
>is a significant flaw in the approach you outlined in another
>message, where a struct is used to place and align the payload
>data within a larger package structure, and an offset for
>locating the data is put in the package header. The problem is,
>the alignment guarantees for the processor (and implementation)
>that _produces_ the package may not be sufficient to meet the
>alignment requirements for the processor (and implementation)
>that _receives_ the package. Whatever alignment guarantees are
>made must suffice to meet the requirements for all processors
>and all implementations simultaneously. This stipulation is
>what takes the problem out of the realm of just writing
>"portable code". Getting the alignment exactly right just in
>the package-creating process doesn't solve the problem.
No. You can play the same game at the receiving end to see what the
offset is at the receiving end. They had better be the same. If not
that is prima facie evidence that the implementations are
inconsistent.
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
What is the right way to do this simple thing cri@tiac.net (Richard Harter) - 2012-03-10 19:26 +0000
Re: What is the right way to do this simple thing Don Y <this@isnotme.com> - 2012-03-10 12:57 -0700
Re: What is the right way to do this simple thing ImpalerCore <jadill33@gmail.com> - 2012-03-10 14:12 -0800
Re: What is the right way to do this simple thing cri@tiac.net (Richard Harter) - 2012-03-10 23:31 +0000
Re: What is the right way to do this simple thing Ian Collins <ian-news@hotmail.com> - 2012-03-11 13:06 +1300
Re: What is the right way to do this simple thing cri@tiac.net (Richard Harter) - 2012-03-11 00:44 +0000
Re: What is the right way to do this simple thing Ian Collins <ian-news@hotmail.com> - 2012-03-11 14:15 +1300
Re: What is the right way to do this simple thing cri@tiac.net (Richard Harter) - 2012-03-11 04:46 +0000
Re: What is the right way to do this simple thing Ian Collins <ian-news@hotmail.com> - 2012-03-11 21:27 +1300
Re: What is the right way to do this simple thing cri@tiac.net (Richard Harter) - 2012-03-11 17:23 +0000
Re: What is the right way to do this simple thing Ian Collins <ian-news@hotmail.com> - 2012-03-12 10:01 +1300
Re: What is the right way to do this simple thing cri@tiac.net (Richard Harter) - 2012-03-13 21:18 +0000
Re: What is the right way to do this simple thing Ian Collins <ian-news@hotmail.com> - 2012-03-14 10:23 +1300
Re: What is the right way to do this simple thing Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-03-11 11:59 +0000
Re: What is the right way to do this simple thing cri@tiac.net (Richard Harter) - 2012-03-11 16:51 +0000
Re: What is the right way to do this simple thing Gene <gene.ressler@gmail.com> - 2012-03-13 07:32 -0700
Re: What is the right way to do this simple thing cri@tiac.net (Richard Harter) - 2012-03-13 21:46 +0000
Re: What is the right way to do this simple thing ImpalerCore <jadill33@gmail.com> - 2012-03-12 07:28 -0700
Re: What is the right way to do this simple thing ImpalerCore <jadill33@gmail.com> - 2012-03-12 08:13 -0700
Re: What is the right way to do this simple thing cri@tiac.net (Richard Harter) - 2012-03-13 21:51 +0000
Re: What is the right way to do this simple thing Tim Rentsch <txr@alumni.caltech.edu> - 2012-03-10 14:21 -0800
Re: What is the right way to do this simple thing cri@tiac.net (Richard Harter) - 2012-03-11 01:40 +0000
Re: What is the right way to do this simple thing Tim Rentsch <txr@alumni.caltech.edu> - 2012-03-11 14:11 -0700
Re: What is the right way to do this simple thing cri@tiac.net (Richard Harter) - 2012-03-13 21:56 +0000
Re: What is the right way to do this simple thing Tim Rentsch <txr@alumni.caltech.edu> - 2012-03-14 14:55 -0700
Re: What is the right way to do this simple thing cri@tiac.net (Richard Harter) - 2012-03-15 21:55 +0000
Re: What is the right way to do this simple thing Tim Rentsch <txr@alumni.caltech.edu> - 2012-03-19 13:33 -0700
Re: What is the right way to do this simple thing Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-03-10 15:21 -0800
Re: What is the right way to do this simple thing cri@tiac.net (Richard Harter) - 2012-03-11 00:47 +0000
Re: What is the right way to do this simple thing Philip Lantz <prl@canterey.us> - 2012-03-11 01:07 -0800
Re: What is the right way to do this simple thing cri@tiac.net (Richard Harter) - 2012-03-11 16:14 +0000
Re: What is the right way to do this simple thing Markus Wichmann <nullplan@gmx.net> - 2012-03-11 13:47 +0100
Re: What is the right way to do this simple thing cri@tiac.net (Richard Harter) - 2012-03-11 16:24 +0000
Re: What is the right way to do this simple thing cri@tiac.net (Richard Harter) - 2012-03-11 21:01 +0000
Re: What is the right way to do this simple thing Anders Wegge Keller <wegge@wegge.dk> - 2012-03-12 00:05 +0100
Re: What is the right way to do this simple thing cri@tiac.net (Richard Harter) - 2012-03-13 21:57 +0000
Re: What is the right way to do this simple thing cri@tiac.net (Richard Harter) - 2012-03-11 23:06 +0000
Re: What is the right way to do this simple thing Geoff <geoff@invalid.invalid> - 2012-03-11 17:34 -0700
Re: What is the right way to do this simple thing cri@tiac.net (Richard Harter) - 2012-03-13 22:00 +0000
Re: What is the right way to do this simple thing Geoff <geoff@invalid.invalid> - 2012-03-13 18:12 -0700
Re: What is the right way to do this simple thing cri@tiac.net (Richard Harter) - 2012-03-14 03:38 +0000
Re: What is the right way to do this simple thing Geoff <geoff@invalid.invalid> - 2012-03-14 00:49 -0700
csiph-web