Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Tor Project
Core
Tor
Commits
8d29866b
Commit
8d29866b
authored
12 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'public/bug8002' into maint-0.2.4
parents
de7e99f8
22804c03
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
changes/bug8002
+5
-0
5 additions, 0 deletions
changes/bug8002
src/common/compat.c
+27
-2
27 additions, 2 deletions
src/common/compat.c
with
32 additions
and
2 deletions
changes/bug8002
0 → 100644
+
5
−
0
View file @
8d29866b
o Minor bugfixes:
- When autodetecting the number of CPUs, use the number of available
CPUs in preferernce to the number of configured CPUs. Inform the
user if this reduces the number of avialable CPUs. Fix for bug 8002.
Bugfix on 0.2.3.1-alpha.
This diff is collapsed.
Click to expand it.
src/common/compat.c
+
27
−
2
View file @
8d29866b
...
...
@@ -2313,8 +2313,33 @@ compute_num_cpus_impl(void)
return
(
int
)
info
.
dwNumberOfProcessors
;
else
return
-
1
;
#elif defined(HAVE_SYSCONF) && defined(_SC_NPROCESSORS_CONF)
long
cpus
=
sysconf
(
_SC_NPROCESSORS_CONF
);
#elif defined(HAVE_SYSCONF)
#ifdef _SC_NPROCESSORS_CONF
long
cpus_conf
=
sysconf
(
_SC_NPROCESSORS_CONF
);
#else
long
cpus_conf
=
-
1
;
#endif
#ifdef _SC_NPROCESSORS_ONLN
long
cpus_onln
=
sysconf
(
_SC_NPROCESSORS_ONLN
);
#else
long
cpus_onln
=
-
1
;
#endif
long
cpus
=
-
1
;
if
(
cpus_conf
>
0
&&
cpus_onln
<
0
)
{
cpus
=
cpus_conf
;
}
else
if
(
cpus_onln
>
0
&&
cpus_conf
<
0
)
{
cpus
=
cpus_onln
;
}
else
if
(
cpus_onln
>
0
&&
cpus_conf
>
0
)
{
if
(
cpus_onln
<
cpus_conf
)
{
log_notice
(
LD_GENERAL
,
"I think we have %ld CPUS, but only %ld of them "
"are available. Telling Tor to only use %ld. You can over"
"ride this with the NumCPUs option"
,
cpus_conf
,
cpus_onln
,
cpus_onln
);
}
cpus
=
cpus_onln
;
}
if
(
cpus
>=
1
&&
cpus
<
INT_MAX
)
return
(
int
)
cpus
;
else
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment