- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What guarantee's does Concurrent_Vector's push_back have? If I push items onto it, will they be inserted in order (temporally)?
say:
time 0 time 1
thread1 : pushA
thread2 : pushB pushC
is there a guarantee that C will be placed after A, and B (A and B's order with respect to each other isn't important)
Or I could end up with B-C-A for example?
On a side note the comment in concurrent_vector.h on line 623 for the compact method is outdated
//! Optimize memory usage and fragmentation. Returns true if optimization occurred.
void compact();
void compact();
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - robert.jay.gould
What guarantee's does Concurrent_Vector's push_back have? If I push items onto it, will they be inserted in order (temporally)?
say:
time 0 time 1
thread1 : pushA
thread2 : pushB pushC
is there a guarantee that C will be placed after A, and B (A and B's order with respect to each other isn't important)
Or I could end up with B-C-A for example?
But it's not guaranteed that they will have consecutive indexes since B-A-C is also possible. Such an assurance can be given by grow_by(2) call.
Thanks, I'll fix it.On a side note the comment in concurrent_vector.h on line 623 for the compact method is outdated//! Optimize memory usage and fragmentation. Returns true if optimization occurred.
void compact();

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page