Carrot2

Implement a fixed-size component pool implementing IParameterizedPool.

Details

  • Type: New Feature New Feature
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 3.4.0
  • Component/s: C# API, Framework Core
  • Labels:
    None

Description

A fixed-size component pool has several benefits:

  • it can preallocate a given set of components,
  • it can work on a fixed number of components, for example equal to the number of cores,
  • no surprises with soft/weak references vanishing under load.
  • no surprises when porting to .NET (mono has a very different GC model).

Activity

Hide
Dawid Weiss added a comment -

Look at ControllerTest.java, search for: "Create a size-one pool because tests depend on the first object instantiated.". If you create a fixed-size pool of 2 or more components tests fail, I couldn't diagnose why – I suspect the fact that FixedSizePool instantiates the entire pool of objects immediately may be of importance here.

Show
Dawid Weiss added a comment - Look at ControllerTest.java, search for: "Create a size-one pool because tests depend on the first object instantiated.". If you create a fixed-size pool of 2 or more components tests fail, I couldn't diagnose why – I suspect the fact that FixedSizePool instantiates the entire pool of objects immediately may be of importance here.
Hide
Dawid Weiss added a comment -

Check the last comment in this issue; can we do something about it or should we leave as-is?

Show
Dawid Weiss added a comment - Check the last comment in this issue; can we do something about it or should we leave as-is?
Hide
Stanisław Osiński added a comment -

Yes, the reason is probably the eager initialization. I'll take a look at it and fix the test.

Show
Stanisław Osiński added a comment - Yes, the reason is probably the eager initialization. I'll take a look at it and fix the test.
Hide
Stanisław Osiński added a comment -

Fixed in trunk, testing of pooling aspects of the fixed-size-based controller added.

Show
Stanisław Osiński added a comment - Fixed in trunk, testing of pooling aspects of the fixed-size-based controller added.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: