Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(875)

#12655: Expose sched.h functions

Can't Edit
Can't Publish+Mail
Start Review
Created:
1 year, 9 months ago by benjamin
Modified:
9 months, 2 weeks ago
Reviewers:
neologix, storchaka, pitrou
CC:
Georg, amaury.forgeotdarc, AntoinePitrou, haypo, giampaolo.rodola, Benjamin Peterson, anacrolix, Charles-François Natali, rosslagerwall, devnull_psf.upfronthosting.co.za, storchaka
Visibility:
Public.

Patch Set 1 #

Patch Set 2 #

Total comments: 9

Patch Set 3 #

Patch Set 4 #

Patch Set 5 #

Total comments: 15
Unified diffs Side-by-side diffs Delta from patch set Stats Patch
Doc/library/os.rst View 1 2 3 4 1 chunk +9 lines, -39 lines 0 comments Download
Lib/test/test_posix.py View 1 2 3 4 2 chunks +21 lines, -76 lines 0 comments Download
Modules/posixmodule.c View 1 2 3 4 4 chunks +134 lines, -328 lines 15 comments Download

Messages

Total messages: 5
neologix_free.fr
Here's a review. > > Why didn't you use something like: > > > > ...
1 year, 9 months ago #1
Benjamin Peterson
Thanks for the review. http://bugs.python.org/review/12655/diff/3115/9657 File Lib/test/test_posix.py (right): http://bugs.python.org/review/12655/diff/3115/9657#newcode880 Lib/test/test_posix.py:880: interval = posix.sched_rr_get_interval(0) On 2011/07/31 ...
1 year, 9 months ago #2
storchaka
http://bugs.python.org/review/12655/diff/5651/Modules/posixmodule.c File Modules/posixmodule.c (right): http://bugs.python.org/review/12655/diff/5651/Modules/posixmodule.c#newcode5744 Modules/posixmodule.c:5744: ncpus = 16; "Since CPU sets are bitsets allocated ...
9 months, 2 weeks ago #3
AntoinePitrou
http://bugs.python.org/review/12655/diff/5651/Modules/posixmodule.c File Modules/posixmodule.c (right): http://bugs.python.org/review/12655/diff/5651/Modules/posixmodule.c#newcode5744 Modules/posixmodule.c:5744: ncpus = 16; On 2012/08/04 15:09:05, storchaka wrote: > ...
9 months, 2 weeks ago #4
storchaka
9 months, 2 weeks ago #5
http://bugs.python.org/review/12655/diff/5651/Modules/posixmodule.c
File Modules/posixmodule.c (right):

http://bugs.python.org/review/12655/diff/5651/Modules/posixmodule.c#newcode5744
Modules/posixmodule.c:5744: ncpus = 16;
On 2012/08/04 15:14:15, AntoinePitrou wrote:
> On 2012/08/04 15:09:05, storchaka wrote:
> > "Since CPU sets are bitsets allocated in units of long words, the actual
> number
> > of CPUs in a dynamically allocated CPU set will be rounded up to the next
> > multiple of sizeof(unsigned long)."
> > 
> >     ncpus = sizeof(unsigned long) * CHAR_BIT;
> 
> Well, starting at 16 is a heuristic. I don't really see a point in making it
> more complicated.

There is no sense to start less than sizeof(unsigned long) * CHAR_BIT. For 16
and 32 cpus same size will be allocated.

http://bugs.python.org/review/12655/diff/5651/Modules/posixmodule.c#newcode5770
Modules/posixmodule.c:5770: if (cpu > INT_MAX - 1) {
On 2012/08/04 15:14:15, AntoinePitrou wrote:
> On 2012/08/04 15:09:05, storchaka wrote:
> > "The constant CPU_SETSIZE (currently 1024) specifies a value one greater
than
> > the maximum CPU number that can be stored in cpu_set_t."
> > 
> >     if (cpu >= CPU_SETSIZE) {
> 
> You can store more than CPU_SETSIZE if you allocate the cpu_set_t
dynamically:
> 
> “Because some applications may require the ability to dynamically size CPU
sets
> (e.g., to allocate sets larger than that defined by the standard cpu_set_t
data
> type), glibc nowadays provides a set of macros
> to support this.”

You're right. I'm wrong.
Sign in to reply to this message.

RSS Feeds Recent Issues | This issue
This is Rietveld cbc36f91f3f7