[zeromq-dev] Ada Bindings for 0mq

Per Sandberg per.sandberg at bredband.net
Wed Mar 31 21:12:43 CEST 2010



On 03/31/2010 08:32 AM, Martin Sustrik wrote:
> Hi Per,
>
>>>> Whats missing in order to get a full binding is a a new routine to init
>>>> context with a callbacks for 0mq internal thread start and termination.
>>>
>>> What would that be good for? 0MQ is managing it's internal threads
>>> itself. So far there haven't been a request for running user code in I/O
>>> threads.
>> May be it just an misinterpretation of the interface, but i read out the
>> worst scenario and thougt that send is some instances was an non
>> blocking operation and that free could be called by some of the
>> I/O-threads, but if thats not the case the extra interface isn't needed.
>
> Yes, it's the case. So what you need is to init Ada infrastructure in
> 0MQ I/O threads so that you can deallocate Ada-allocated chunks of
> memory, right?
>
Yes reason is to present the thread to the runtime and the extra 
interface wont not needed for 98% of the cases but since Ada has 
threading and parallelism built into the language it self I prefer to 
play it safe.


>>> In any case, if you want to reference your binding from www.zeromq.org,
>>> create an account there (top right of the page) and let me know your
>>> login. I'll create a page for ADA binding (same as other bindings have)
>>> and give you write access.
>> Yes i think that would be an good idea and my login on "www.zeromq.org"
>> is "persan".
>
> OK. I've send you an invitation. Once you accept it you'll have write
> access. I've created a page for you here:
>
> http://www.zeromq.org/bindings:ada
>
> I've pasted in content of python binding webpage so that you have a
> template to start with. Once you are ready, ping me and I'll link the
> page from the left pane as other language bindings are.
>
Thanks I have done quick update, but its still alpha status.


One question concerning the flags since there are some options there the 
mapping could ether be
   an array (option_0..Option_32) of boolean; -- where the options 
should have good names
or
   an unsigned_32 where almost the same semantics applies.

The difference in code would be around the lines:
---
   type option_kind is (Hidden,Some,Maximize,....Last);
   type Flags is array( Hidden..Last) of Boolean;
   Flag : Flags := (Hidden => True,Others => False);
   No_Flags : constant Flags := (others => False);
-- or
   type Flags is Mod 2**32;
   Hidden : constant Flag    := 2#1000_0000_0000_0000#;
   No_Flags : constant Flags := 2#0000_0000_0000_0000#;
   Flag : Flags :=Hidden;
-----
In both cases operations like "and", "or", "+" are available to objects 
of the type Flags, so its more a matter of intent and the types semantics.

/Per



More information about the zeromq-dev mailing list