Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for osyield1 (0.24 sec)

  1. src/runtime/export_windows_test.go

    // license that can be found in the LICENSE file.
    
    // Export guts for testing.
    
    package runtime
    
    import "unsafe"
    
    const MaxArgs = maxArgs
    
    var (
    	OsYield                 = osyield
    	TimeBeginPeriodRetValue = &timeBeginPeriodRetValue
    )
    
    func NumberOfProcessors() int32 {
    	var info systeminfo
    	stdcall1(_GetSystemInfo, uintptr(unsafe.Pointer(&info)))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 19 17:25:00 UTC 2024
    - 759 bytes
    - Viewed (0)
  2. src/runtime/cpuprof.go

    func (p *cpuProfile) add(tagPtr *unsafe.Pointer, stk []uintptr) {
    	// Simple cas-lock to coordinate with setcpuprofilerate.
    	for !prof.signalLock.CompareAndSwap(0, 1) {
    		// TODO: Is it safe to osyield here? https://go.dev/issue/52672
    		osyield()
    	}
    
    	if prof.hz.Load() != 0 { // implies cpuprof.log != nil
    		if p.numExtra > 0 || p.lostExtra > 0 || p.lostAtomic > 0 {
    			p.addExtra()
    		}
    		hdr := [1]uint64{1}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 8.5K bytes
    - Viewed (0)
  3. src/runtime/tracecpu.go

    	}
    	if gp != nil {
    		hdr[1] = gp.goid
    	}
    	hdr[2] = uint64(mp.procid)
    
    	// Allow only one writer at a time
    	for !trace.signalLock.CompareAndSwap(0, 1) {
    		// TODO: Is it safe to osyield here? https://go.dev/issue/52672
    		osyield()
    	}
    
    	if log := trace.cpuLogWrite[gen%2].Load(); log != nil {
    		// Note: we don't pass a tag pointer here (how should profiling tags
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 15 17:03:35 UTC 2024
    - 8.7K bytes
    - Viewed (0)
  4. src/runtime/os_plan9.go

    	return 0
    }
    
    func initsig(preinit bool) {
    	if !preinit {
    		notify(unsafe.Pointer(abi.FuncPCABI0(sigtramp)))
    	}
    }
    
    //go:nosplit
    func osyield() {
    	sleep(0)
    }
    
    //go:nosplit
    func osyield_no_g() {
    	osyield()
    }
    
    //go:nosplit
    func usleep(µs uint32) {
    	ms := int32(µs / 1000)
    	if ms == 0 {
    		ms = 1
    	}
    	sleep(ms)
    }
    
    //go:nosplit
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 15:41:45 UTC 2024
    - 10.3K bytes
    - Viewed (0)
  5. src/runtime/lock_futex.go

    		// Try for lock, rescheduling.
    		for i := 0; i < passive_spin; i++ {
    			for l.key == mutex_unlocked {
    				if atomic.Cas(key32(&l.key), mutex_unlocked, wait) {
    					timer.end()
    					return
    				}
    			}
    			osyield()
    		}
    
    		// Sleep.
    		v = atomic.Xchg(key32(&l.key), mutex_sleeping)
    		if v == mutex_unlocked {
    			timer.end()
    			return
    		}
    		wait = mutex_sleeping
    		futexsleep(key32(&l.key), mutex_sleeping, -1)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 17:57:34 UTC 2024
    - 5.4K bytes
    - Viewed (0)
  6. src/runtime/signal_unix.go

    	// have been delivered. Give other threads a chance to run and
    	// pick up the signal.
    	osyield()
    	osyield()
    	osyield()
    
    	// If that didn't work, try _SIG_DFL.
    	setsig(sig, _SIG_DFL)
    	raise(sig)
    
    	osyield()
    	osyield()
    	osyield()
    
    	// If we are still somehow running, just exit with the wrong status.
    	exit(2)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 10 16:04:54 UTC 2024
    - 45K bytes
    - Viewed (0)
  7. src/runtime/lock_sema.go

    			// Unlocked. Try to lock.
    			if atomic.Casuintptr(&l.key, v, v|locked) {
    				timer.end()
    				return
    			}
    			i = 0
    		}
    		if i < spin {
    			procyield(active_spin_cnt)
    		} else if i < spin+passive_spin {
    			osyield()
    		} else {
    			// Someone else has it.
    			// l->waitm points to a linked list of M's waiting
    			// for this lock, chained through m->nextwaitm.
    			// Queue this M.
    			for {
    				gp.m.nextwaitm = muintptr(v &^ locked)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 17:57:37 UTC 2024
    - 6.8K bytes
    - Viewed (0)
  8. src/runtime/preempt.go

    		// that the goroutine is suspended.
    		if i == 0 {
    			nextYield = nanotime() + yieldDelay
    		}
    		if nanotime() < nextYield {
    			procyield(10)
    		} else {
    			osyield()
    			nextYield = nanotime() + yieldDelay/2
    		}
    	}
    }
    
    // resumeG undoes the effects of suspendG, allowing the suspended
    // goroutine to continue from its current safe-point.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 15:41:45 UTC 2024
    - 15.1K bytes
    - Viewed (0)
  9. src/runtime/os_windows.go

    	return stdcall(fn)
    }
    
    // These must run on the system stack only.
    
    //go:nosplit
    func osyield_no_g() {
    	stdcall_no_g(_SwitchToThread, 0, 0)
    }
    
    //go:nosplit
    func osyield() {
    	systemstack(func() {
    		stdcall0(_SwitchToThread)
    	})
    }
    
    //go:nosplit
    func usleep_no_g(us uint32) {
    	timeout := uintptr(us) / 1000 // ms units
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 26 22:55:25 UTC 2024
    - 41.5K bytes
    - Viewed (0)
  10. src/runtime/trace.go

    	//
    	// The critical section on each goroutine here is going to be quite short, so the likelihood
    	// that we observe a zero value is high.
    	for trace.exitingSyscall.Load() != 0 {
    		osyield()
    	}
    
    	// Record some initial pieces of information.
    	//
    	// N.B. This will also emit a status event for this goroutine.
    	tl := traceAcquire()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 21:17:41 UTC 2024
    - 37.1K bytes
    - Viewed (0)
Back to top