Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #93671

Re: How do I set this type variable?

From jacobnavia <jacob@jacob.remcomp.fr>
Newsgroups comp.lang.c
Subject Re: How do I set this type variable?
Date 2016-09-16 23:32 +0200
Organization A noiseless patient Spider
Message-ID <nrhocd$2sq$1@dont-email.me> (permalink)
References <9f7fba02-df47-4d06-aac3-27c01758c3e3@googlegroups.com> <nrhlbq$ocb$1@dont-email.me> <04ef54f2-7d69-4755-85c9-94c00be61762@googlegroups.com>

Show all headers | View raw


Le 16/09/2016 à 22:57, Thiago Adams a écrit :
> If I have a tree of bananas then I think all tree const is useful because

I can run multiples algorithms in parallel using the tree at the same 
time and its thread safe.

If the tree doesn't change, yes, it is immutable

:-)

If no thread modifies the tree, it is thread safe since the data is 
parallel.

But if you run an algorithm, is to find out something about the data 
isn't it? How do you add information to a const tree? Difficult.

Yes, you can do a separation between added data (calculated) and 
original data (const).

Or, you do not modify the tree and rebuild a new non const tree with the 
new calculated data for each node.

The type is no longer const since you can have either a const or non 
const tree of the same shape.

There are many solutions and what is important is to try to be aware of 
the practical problems, the compiler and the computer language used are 
just aid/nuisance whatever.


Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

How do I set this type variable? Thiago Adams <thiago.adams@gmail.com> - 2016-09-16 13:08 -0700
  Re: How do I set this type variable? BartC <bc@freeuk.com> - 2016-09-16 21:40 +0100
    Re: How do I set this type variable? Thiago Adams <thiago.adams@gmail.com> - 2016-09-16 13:57 -0700
      Re: How do I set this type variable? Thiago Adams <thiago.adams@gmail.com> - 2016-09-16 14:07 -0700
      Re: How do I set this type variable? jacobnavia <jacob@jacob.remcomp.fr> - 2016-09-16 23:32 +0200
        Re: How do I set this type variable? Thiago Adams <thiago.adams@gmail.com> - 2016-09-17 12:05 -0700
          Re: How do I set this type variable? BartC <bc@freeuk.com> - 2016-09-17 20:46 +0100
    Re: How do I set this type variable? Malcolm McLean <malcolm.mclean5@btinternet.com> - 2016-09-17 17:19 -0700
      Re: How do I set this type variable? supercat@casperkitty.com - 2016-09-17 22:47 -0700
        Re: How do I set this type variable? luser droog <luser.droog@gmail.com> - 2016-09-18 13:44 -0700
        Re: How do I set this type variable? Ian Collins <ian-news@hotmail.com> - 2016-09-19 17:00 +1200
          Re: How do I set this type variable? David Brown <david.brown@hesbynett.no> - 2016-09-19 09:34 +0200
            Re: How do I set this type variable? supercat@casperkitty.com - 2016-09-19 08:18 -0700
  Re: How do I set this type variable? Richard Damon <Richard@Damon-Family.org> - 2016-09-23 12:07 -0400
    Re: How do I set this type variable? Tim Rentsch <txr@alumni.caltech.edu> - 2016-09-23 11:57 -0700

csiph-web