[zeromq-dev] Ada Bindings for 0mq

Martin Sustrik sustrik at 250bpm.com
Thu Apr 1 07:56:42 CEST 2010


Per,

>> 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.

Can't you present the thread to the runtime when the free function is 
called for the first time?

Btw, all the bindings except C and C++ have serious problems with 
"supply the free function" style of sending messages. In most cases is 
seems unsolvable thus what they do is that they simply copy the message 
within the binding to make it independent of language's memory 
management/garbage collection.

>> 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.

No problem. I'll link it so people can see it.

> 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.

I would say that depends on what's the best practice in Ada.

Thanks!
Martin



More information about the zeromq-dev mailing list