Boost logo

Boost :

Subject: Re: [boost] New Boost.XInt Library, request preliminary review
From: Chad Nelson (chad.thecomfychair_at_[hidden])
Date: 2010-03-26 17:47:04


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> i had a look at the docs and i find the lib pretty cool
> the docs seem pretty clear to me (even though i don't like this plain
> style of docs)

I can "pretty them up" before the final release. I just wanted to get
the information itself written down for review.

> i have a copuple of suggestions
>
> first, to make 'xint::integer' consistent (if i were you) i'd make all
> public member functions non-member friend functions because 'int' and
> other fundamentals have no member functions

Most of the non-operator member functions are there because n1692
required them.

> and second, the docs lack algorithmic complexity estimation for
> operations
> as an end user i would like to know the order of time and/or space an
> operation will cost me

Easy enough to supply. I'll put it on the to-do list for the second review.

> BTW i like the presence of implicit sharing
> my only question is can i make it (the sharing) thread safe by defining
> 'XINT_THREADSAFE'? (hm... here arises a question about operations thread
> safety notes in the docs)

That's covered. From the Compile-Time Options page:

- ------------------------8<---------------------------
#define XINT_THREADSAFE

This disables the copy-on-write optimization that the library uses by
default, sets the exception-blocking code to work on a per-thread basis,
and protects some shared resources from multiple simultaneous accesses,
allowing fully thread-safe operation. You are still responsible for
ensuring that only one thread can access any specific integer at a time.

When this option is used, you must also link your program with the
Boost.Thread library.
- ------------------------8<---------------------------

I should probably move that information to the Thread-Safe Operation
page instead, and just point the Compile-Time Options page to it. It
would fit better there.

> i don't like the template constructor however you can ignore this
> point since i can not provide any arguments yet

I tried several different ways to convert native integer types to
xint::integer. That's the best one I found. If you could suggest an
alternative, I'd certainly be willing to entertain it.

> what about compile time fixed precision ints? like 'xint::fixed<128>'
> with '128' denoting number of bits (or bytes?)

I don't see any obvious reason why that couldn't be implemented on top
of xint::integer. It should only require a fairly simple set of template
wrappers. I think it should be deferred until the underlying library
makes it through the review process though.

Also, I'm noting who made suggestions for the library, for an
acknowledgments page. Do you prefer to be known only as "Pavel", or do
you have a publicly-known last name?
- --
Chad Nelson
Oak Circle Software, Inc.
*
*
*
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkutK1QACgkQp9x9jeZ9/wTGegCgrGrrICQTbna4Nbklmn9cEMI7
TJ8An0pWiGJmKPnf8n1KMs+gnAn/dxOl
=LqqK
-----END PGP SIGNATURE-----


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk