Memory and Thread Placement Optimization Developer's Guide

Object Methods in the Solaris::lgrp Module

new([$view])

This method creates a new Sun::Solaris::Lgrp object. An optional argument is passed to the lgrp_init() function. This method uses a value for the $view argument of LGRP_VIEW_OS by default.

cookie()

This function returns a transparent cookie that is passed to functions that accept a cookie.

version([$version])

This method returns the current version of the liblgrp(3LIB) library when you call it without an argument. This is a wrapper for the lgrp_version() function with LGRP_VER_NONE as the default value of the $version argument.

stale()

This method returns T if the lgroup information in the object is stale. This method returns F in all other cases. The stale method is a wrapper for the lgrp_cookie_stale() function.

view()

This method returns the snapshot's view of the lgroup hierarchy. The view() method is a wrapper for the lgrp_view() function.

root()

This method returns the root lgroup. The root() method is a wrapper for the lgrp_root() function.

children($lgrp)

This method returns the list of lgroups that are children of the specified lgroup. The children method is a wrapper for the lgrp_children() function.

parents($lgrp)

This method returns the list of lgroups that are parents of the specified lgroup. The parents method is a wrapper for the lgrp_parents() function.

nlgrps()

This method returns the number of lgroups in the hierarchy. The nlgrps() method is a wrapper for the lgrp_nlgrps() function.

mem_size($lgrp, $type, $content)

This method returns the memory size of the given lgroup in bytes. The mem_size method is a wrapper for the lgrp_mem_size() function.

cpus($lgrp, $context)

This method returns the list of CPUs that are in the lgroup specified by the $lgrp argument. The cpus method is a wrapper for the lgrp_cpus() function.

resources($lgrp, $type)

This method returns the list of lgroups that directly contain resources of the specified type. The resources method is a wrapper for the lgrp_resources() function.

home($idtype, $id)

This method returns the home lgroup for the given process or thread. The home method is a wrapper for the lgrp_home() function.

affinity_get($idtype, $id, $lgrp)

This method returns the affinity that the LWP has to a given lgroup. The affinity_get() method is a wrapper for the lgrp_affinity_get() function.

affinity_set($idtype, $id, $lgrp, $affinity)

This method sets the affinities that the LWPs specified by the $idtype and $id arguments have for the given lgroup. The affinity_set() method is a wrapper for the lgrp_affinity_set() function.

lgrps([$lgrp])

This method returns the list of all of the lgroups in a hierarchy starting from the lgroup specified by the value of the $lgrp argument. The hierarchy starts from the root lgroup when you do not specify a value for the $lgrp argument. The lgrps() method is a wrapper for the lgrp_lgrps() function.

leaves([$lgrp])

This method returns the list of all of the leaf lgroups in a hierarchy starting from the lgroup specified by the value of the $lgrp argument. The hierarchy starts from the root lgroup when you do not specify a value for the $lgrp argument. The leaves() method is a wrapper for the lgrp_leaves() function.

isleaf($lgrp)

This method returns True if the lgroup specified by the value of the $lgrp argument is a leaf lgroup. A leaf lgroup has no children. This method returns False in all other cases. The isleaf method is a wrapper for the lgrp_isleaf function.

latency($from, $to)

This method returns the latency value between a hardware resource in the lgroup specified by the $from argument to a hardware resource in the lgroup specified by the $to argument. The latency method uses the lgrp_latency() function in version 1 of liblgrp. The latency method uses the lgrp_latency_cookie() function in newer versions of liblgrp.