index   headlines   <<previous   next>> 

The Kernel Kit
Developer Release Notes
BeOS Release 4.5

Bug Fixes and Improvements


Team Usage

      The new get_team_usage_info() function retrieves cycle-consumption data for a team:

status_t get_team_usage_info(team_id team, int32 depth, team_usage_info *usage);

team is the team_id of the team you want to look at.  depth is one of these two constants:

ConstantMeaning
B_USAGE_SELF Gets statistics for the designated team.  Normal applications will always use this constant.
B_USAGE_CHILDREN Gets statistics for the designated team's "children," where a child is a separate process (a whole other team, actually) that's executed from a forked thread.  Child usage is only meaningful to certain POSIX apps -- you know who you are.

usage returns the statistics in a team_usage_info struct:

typedef struct {
   bigtime_t user_time;
   bigtime_t kernel_time;
} team_usage_info;

The fields are:

FieldMeaning
user_time Amount of time spent executing user code.
kernel_time Amount of time spent executing kernel code.

If the function doesn't return B_OK, the information in usage is invalid.


Port Closure


Semaphore Timeout

      There are two new timeout flags that you pass to acquire_sem_etc():

  • B_ABSOLUTE_TIMEOUT sets the timeout as an absolute time since the system was booted.

  • B_RELATIVE_TIMEOUT sets the timeout as a relative amount (relative to now).

The old B_TIMEOUT flag is the same as B_RELATIVE_TIMEOUT; the old flag will continue work, but new code should use the new flags.


Alarms

      The new set_alarm() function lets you ask for a SIGALRM signal to be sent after some amount of time:

bigtime_t set_alarm(bigtime_t when, uint32 flag);

The flag value determines how the when value is interpreted:

FlagMeaning
B_ONE_SHOT_ABSOLUTE_ALARM The signal is sent once; when is an absolute time.
B_ONE_SHOT_RELATIVE_ALARM The signal is sent once; when is relative to now.
B_PERIODIC_ALARM The signal is sent iteratively, every when microseconds.

If this is a periodic alarm, the set_alarm() function returns 0; otherwise, the function returns the absolute time that the handler will be called.


Kernel Drivers



 index   headlines   <<previous   next>> 

BeOS Release 4.1


Copyright © 1999 Be, Inc.  All rights reserved.