[haiku-bugs] Re: [Haiku] #5790: panic: out of ports, but sUsedPorts is broken

  • From: "bonefish" <trac@xxxxxxxxxxxx>
  • Date: Mon, 03 May 2010 15:25:45 -0000

#5790: panic: out of ports, but sUsedPorts is broken
---------------------------+------------------------------------------------
 Reporter:  mmlr           |       Owner:  axeld         
     Type:  bug            |      Status:  new           
 Priority:  normal         |   Milestone:  R1/alpha2     
Component:  System/Kernel  |     Version:  R1/Development
 Keywords:                 |   Blockedby:                
 Platform:  All            |    Blocking:                
---------------------------+------------------------------------------------

Comment(by bonefish):

 Replying to [comment:9 mmlr]:
 > I thought about using a list of sorted "free ranges" that can be
 extended/joined on freeing an id and updated/removed on id allocation.
 Could be made generic and used for area_id as well.

 You might want to have a look at Bonwick's resource allocator (don't have
 a link at hand, but shouldn't be too hard to find -- usually in
 combination with the slab allocator), which was invented to do pretty much
 exactly that. Though, a simple solution -- like an increment + lookup loop
 until free spot found -- should work well enough (at least for alpha 2,
 where I wouldn't want to introduce larger amounts of untested code
 anymore), particularly in the cases where the domain (positive int32) is
 several orders of magnitude greater than the total count limit.

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/5790#comment:10>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: