[Gambas-user] Gambas on Haiku?

T Lee Davidson t.lee.davidson at gmail.com
Tue Feb 22 00:53:38 CET 2022


On 2/21/22 13:15, T Lee Davidson wrote:
> On 2/21/22 10:17, Benoît Minisini wrote:
[snip]
>> But we must add in this include file a Haiku OS function that returns the number of physical threads the CPU(s) can handle.
> 
> https://www.haiku-os.org/docs/api/:
> "The Haiku API is based on the BeOS R5 API but changes and additions have been included where appropriate. [... ] A complete 
> reference to the BeOS R5 API is available on the web in The Be Book." [1]
> 
> The Function Index in that book lists the get_system_info() function [2]. This function returns a system_info structure that 
> includes fields such as cpu_count, max_threads, and used_threads.
> 
> Is that what we need?

The following C code on Haiku (as a KVM/QEMU guest given 2 cpu's):
[C]
#include <stdio.h>
#include <kernel/OS.h>

int main() {

     system_info sys_info;

     get_system_info(&sys_info);
     printf("ncpus: %d\nmax_threads: %d\nused_threads: %d", sys_info.cpu_count, sys_info.max_threads, sys_info.used_threads);
     printf("available threads: %d", sys_info.max_threads - sys_info.used_threads);
}
[/C]

produced:
[console]
ncpus: 2
max_threads: 4096
used_threads: 150
available threads: 3946
[/console]

Somehow I don't think threads is what we want.


-- 
Lee

P.S. Does anyone know how to share the clipboard with a KVM/QEMU Haiku guest?


More information about the User mailing list