-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
affinity: remove darwin implementation and make it no-op
It seems it is not possible to actually set affinity on macOS so we make it a no-op and make all CPU cores available https://developer.apple.com/forums/thread/44002
- Loading branch information
1 parent
1595cc2
commit f18fd72
Showing
7 changed files
with
53 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
;; CPU affinity (Darwin) | ||
|
||
;;;; Copyright (C) 2022 Aleix Conchillo Flaqué <[email protected]> | ||
;;;; | ||
;;;; This library is free software; you can redistribute it and/or | ||
;;;; modify it under the terms of the GNU Lesser General Public | ||
;;;; License as published by the Free Software Foundation; either | ||
;;;; version 3 of the License, or (at your option) any later version. | ||
;;;; | ||
;;;; This library is distributed in the hope that it will be useful, | ||
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
;;;; Lesser General Public License for more details. | ||
;;;; | ||
;;;; You should have received a copy of the GNU Lesser General Public License | ||
;;;; along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
;;; Guile defines setaffinity and getaffinity in some systems (e.g. Linux). For | ||
;;; those systems where those procedures are not available there should be a | ||
;;; Fibers' specific implementation available through the fibers-affinity | ||
;;; library. | ||
|
||
(define-module (fibers affinity) | ||
#:use-module (ice-9 threads) | ||
#:export (getaffinity* setaffinity*)) | ||
|
||
;; | ||
;; It seems it is not possible to link a thread to a specific core on | ||
;; macOS. See, for example: https://developer.apple.com/forums/thread/44002. | ||
;; | ||
;; So for now getaffinity/setaffinity are no-ops. | ||
;; | ||
|
||
(define (getaffinity* pid) | ||
(make-bitvector (current-processor-count) 1)) | ||
|
||
(define (setaffinity* pid affinity) *unspecified*) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters