Forum Jump

Select Group :
Select Forum :
Sorted By :
Sort Order :
From The :
 
Thread Tools  Search this thread 
eyalk
Total Points:
130
Status Points:
80
Green Belt
November 9, 2009 5:25 AM PST
Memory allocation
Hi:

How can we allocate the memory used by the parallel_for in advance (during the constructions stage) - we try to avoid dynamic allocation as much as we can.

Thanks
Raf Schietekat
Total Points:
16,765
Status Points:
16,765
Black Belt
November 9, 2009 6:26 AM PST
Rate
 
#1

I don't see how you could do that, but have you seen a problem or are you just attempting possibly premature optimisation?



eyalk
Total Points:
130
Status Points:
80
Green Belt
November 9, 2009 6:41 AM PST
Rate
 
#2 Reply to #1
Quoting - Raf Schietekat

I don't see how you could do that, but have you seen a problem or are you just attempting possibly premature optimisation?


we try to avoid dynamic allocation because of the nature of our system. if we run parallel_for during the initialization stage of our software, would it solve the problem? would the allocation of all the needed memory would be performed than?

Alexey Kukanov (Intel)
Total Points:
13,376
Status Points:
13,376
Black Belt
November 9, 2009 7:41 AM PST
Rate
 
#3 Reply to #2
Quoting - eyalk
we try to avoid dynamic allocation because of the nature of our system. if we run parallel_for during the initialization stage of our software, would it solve the problem? would the allocation of all the needed memory would be performed than?
it would help for some extent, but complete absence of dynamic memory allocation can not be guaranteed.
Could you say more specifically what problems you try to solve by avoiding dynamic allocation?

eyalk
Total Points:
130
Status Points:
80
Green Belt
November 9, 2009 8:48 AM PST
Rate
 
#4 Reply to #3
it would help for some extent, but complete absence of dynamic memory allocation can not be guaranteed.
Could you say more specifically what problems you try to solve by avoiding dynamic allocation?

One of our coding rules is trying to avoid dynamic allocation as much as we can, because during run time there is a possibility that the heap will not have enough memory to allocate. Our system can not allow this to happen (medical care system). So we try to find a way to bring down the amount of dynamic allocation in our code.

Raf Schietekat
Total Points:
16,765
Status Points:
16,765
Black Belt
November 9, 2009 10:58 PM PST
Rate
 
#5 Reply to #4
Quoting - eyalk
One of our coding rules is trying to avoid dynamic allocation as much as we can, because during run time there is a possibility that the heap will not have enough memory to allocate. Our system can not allow this to happen (medical care system). So we try to find a way to bring down the amount of dynamic allocation in our code.
Why worry at all, it's just one patient, right, not, like, a nuclear power plant or something? A bit more seriously, I can understand using bleeding-edge technology in, say, MRI data processing, but actual medical care?


Dmitriy Vyukov
Total Points:
25,382
Status Points:
25,382
Black Belt
November 10, 2009 1:17 AM PST
Rate
 
#6
Quoting - eyalk
How can we allocate the memory used by the parallel_for in advance (during the constructions stage) - we try to avoid dynamic allocation as much as we can.

There is no such feature in TBB.





Intel Software Network Forums Statistics

8445 users have contributed to 31553 threads and 100390 posts to date.
In the past 24 hours, we have 11 new thread(s) 26 new posts(s), and 41 new user(s).

In the past 3 days, the most popular thread for everyone has been Lost in MKL The most posts were made to TBB on linux segfaulting The post with the most views is collapse requires the loops

Please welcome our newest member nonamez