Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 33 for getncpu (0.15 sec)

  1. src/runtime/os_openbsd_arm.go

    // license that can be found in the LICENSE file.
    
    package runtime
    
    func checkgoarm() {
    	// TODO(minux): FP checks like in os_linux_arm.go.
    
    	// osinit not called yet, so ncpu not set: must use getncpu directly.
    	if getncpu() > 1 && goarm < 7 {
    		print("runtime: this system has multiple CPUs and must use\n")
    		print("atomic synchronization instructions. Recompile using GOARM=7.\n")
    		exit(1)
    	}
    }
    
    //go:nosplit
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Dec 05 20:34:30 UTC 2023
    - 662 bytes
    - Viewed (0)
  2. src/runtime/os_netbsd_arm.go

    	mc.__gregs[_REG_R2] = uint32(fn)
    }
    
    func checkgoarm() {
    	// TODO(minux): FP checks like in os_linux_arm.go.
    
    	// osinit not called yet, so ncpu not set: must use getncpu directly.
    	if getncpu() > 1 && goarm < 7 {
    		print("runtime: this system has multiple CPUs and must use\n")
    		print("atomic synchronization instructions. Recompile using GOARM=7.\n")
    		exit(1)
    	}
    }
    
    //go:nosplit
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Dec 05 20:34:30 UTC 2023
    - 1.1K bytes
    - Viewed (0)
  3. src/runtime/os_freebsd_arm.go

    		print("a binary compiled for VFPv3 hard floating point. Recompile adding ,softfloat\n")
    		print("to GOARM or changing GOARM to 6.\n")
    		exit(1)
    	}
    
    	// osinit not called yet, so ncpu not set: must use getncpu directly.
    	if getncpu() > 1 && goarm < 7 {
    		print("runtime: this system has multiple CPUs and must use\n")
    		print("atomic synchronization instructions. Recompile using GOARM=7.\n")
    		exit(1)
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Dec 05 20:34:30 UTC 2023
    - 1.4K bytes
    - Viewed (0)
  4. src/runtime/os_only_solaris.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    // Solaris code that doesn't also apply to illumos.
    
    //go:build !illumos
    
    package runtime
    
    func getncpu() int32 {
    	n := int32(sysconf(__SC_NPROCESSORS_ONLN))
    	if n < 1 {
    		return 1
    	}
    
    	return n
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 28 18:17:57 UTC 2021
    - 357 bytes
    - Viewed (0)
  5. src/runtime/os_openbsd.go

    		return 0, false
    	}
    	return out, true
    }
    
    //go:linkname internal_cpu_sysctlUint64 internal/cpu.sysctlUint64
    func internal_cpu_sysctlUint64(mib []uint32) (uint64, bool) {
    	return sysctlUint64(mib)
    }
    
    func getncpu() int32 {
    	// Try hw.ncpuonline first because hw.ncpu would report a number twice as
    	// high as the actual CPUs running on OpenBSD 6.4 with hyperthreading
    	// disabled (hw.smt=0). See https://golang.org/issue/30127
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 6.2K bytes
    - Viewed (0)
  6. src/runtime/os_dragonfly.go

    // From DragonFly's <sys/sysctl.h>
    const (
    	_CTL_HW      = 6
    	_HW_NCPU     = 3
    	_HW_PAGESIZE = 7
    )
    
    var sigset_all = sigset{[4]uint32{^uint32(0), ^uint32(0), ^uint32(0), ^uint32(0)}}
    
    func getncpu() int32 {
    	mib := [2]uint32{_CTL_HW, _HW_NCPU}
    	out := uint32(0)
    	nout := unsafe.Sizeof(out)
    	ret := sysctl(&mib[0], 2, (*byte)(unsafe.Pointer(&out)), &nout, nil, 0)
    	if ret >= 0 {
    		return int32(out)
    	}
    	return 1
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Dec 05 20:34:30 UTC 2023
    - 7.1K bytes
    - Viewed (0)
  7. src/runtime/os_netbsd.go

    	var out int32
    	nout := unsafe.Sizeof(out)
    	ret := sysctl(&mib[0], uint32(len(mib)), (*byte)(unsafe.Pointer(&out)), &nout, nil, 0)
    	if ret < 0 {
    		return 0, false
    	}
    	return out, true
    }
    
    func getncpu() int32 {
    	if n, ok := sysctlInt([]uint32{_CTL_HW, _HW_NCPUONLINE}); ok {
    		return int32(n)
    	}
    	if n, ok := sysctlInt([]uint32{_CTL_HW, _HW_NCPU}); ok {
    		return int32(n)
    	}
    	return 1
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 10.1K bytes
    - Viewed (0)
  8. src/runtime/os_illumos.go

    				capval = v
    			}
    		}
    
    		// Swap the blocks around so that we can fetch the next value
    		t := rblk
    		rblk = rblkprev
    		rblkprev = t
    		flag = _RCTL_NEXT
    	}
    
    	return capval
    }
    
    func getncpu() int32 {
    	n := int32(sysconf(__SC_NPROCESSORS_ONLN))
    	if n < 1 {
    		return 1
    	}
    
    	if cents := int32(getcpucap()); cents > 0 {
    		// Convert from a percentage of CPUs to a number of CPUs,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 28 18:06:12 UTC 2019
    - 3.9K bytes
    - Viewed (0)
  9. src/runtime/os_darwin.go

    			return
    		}
    	}
    }
    
    // BSD interface for threading.
    func osinit() {
    	// pthread_create delayed until end of goenvs so that we
    	// can look at the environment first.
    
    	ncpu = getncpu()
    	physPageSize = getPageSize()
    
    	osinit_hack()
    }
    
    func sysctlbynameInt32(name []byte) (int32, int32) {
    	out := int32(0)
    	nout := unsafe.Sizeof(out)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Dec 05 20:34:30 UTC 2023
    - 11.9K bytes
    - Viewed (0)
  10. src/runtime/os_freebsd.go

    }
    
    const (
    	_CPU_CURRENT_PID = -1 // Current process ID.
    )
    
    //go:noescape
    func cpuset_getaffinity(level int, which int, id int64, size int, mask *byte) int32
    
    //go:systemstack
    func getncpu() int32 {
    	// Use a large buffer for the CPU mask. We're on the system
    	// stack, so this is fine, and we can't allocate memory for a
    	// dynamically-sized buffer at this point.
    	const maxCPUs = 64 * 1024
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Dec 05 20:34:30 UTC 2023
    - 11.6K bytes
    - Viewed (0)
Back to top