Git Product home page Git Product logo

Comments (6)

olk avatar olk commented on August 18, 2024

maybe the stack is too small

from context.

matovitch avatar matovitch commented on August 18, 2024

But the 2 stacks are allocated on the heap with the stack allocator isn't it ?

FYI, here are the value of the registers (it's the popping of RBP valgrind complains about):

(gdb) i r
rax            0x7fffffffdb08	140737488345864
rbx            0x0	0
rcx            0x0	0
rdx            0x62ac60	6466656
rsi            0x7fffffffd8e8	140737488345320
rdi            0x7fffffffdb08	140737488345864
rbp            0x7fffffffdb60	0x7fffffffdb60
rsp            0x7fffffffda70	0x7fffffffda70
r8             0xffffffffffffffff	-1
r9             0x0	0
r10            0x22	34
r11            0x246	582
r12            0x4016c0	4200128
r13            0x7fffffffdc40	140737488346176
r14            0x0	0
r15            0x0	0
rip            0x4017e4	0x4017e4 <main()+42>
eflags         0x202	[ IF ]
cs             0x33	51
ss             0x2b	43
ds             0x0	0
es             0x0	0
fs             0x0	0
gs             0x0	0
(gdb) c
Continuing.

Breakpoint 2, <lambda()>::operator()(void) const (__closure=0x64ae20) at ../examples/nested.cpp:23
23	            auto&& leafTask = scheduler.makeTask<void>();
(gdb) i r
rax            0x64ae20	6598176
rbx            0x40c40c	4244492
rcx            0x0	0
rdx            0x64ae20	6598176
rsi            0x64aa97	6597271
rdi            0x64ae20	6598176
rbp            0x64a9a0	0x64a9a0
rsp            0x64a980	0x64a980
r8             0x40c863	4245603
r9             0x0	0
r10            0xa42	2626
r11            0x7ffff7adeaf0	140737348758256
r12            0x7ffff7f15018	140737353175064
r13            0x0	0
r14            0x0	0
r15            0x0	0
rip            0x4017a4	0x4017a4 <<lambda()>::operator()(void) const+12>
eflags         0x202	[ IF ]
cs             0x33	51
ss             0x2b	43
ds             0x0	0
es             0x0	0
fs             0x0	0
gs             0x0	0

edit: The first display is the first (non-nested) makeTask.

from context.

matovitch avatar matovitch commented on August 18, 2024

Mea culpa. Nothing to do with boost_context, I had forgotten a return there, so it failed on the allocation of the second buffer by my home-made allocator, I should have looked at the back-trace better. Sorry for disturbing you. :(

Thanks and have a nice day !

from context.

matovitch avatar matovitch commented on August 18, 2024

Now ~1s for more than half a million tasks (1<<19) in a binary-tree-like DAG on my old 4300FX (on a single core of course). Not too bad ! I will try to profile to see what took most of the time. Pretty sure it's the context switch but cannot be too sure. Sorry again for bothering you and thanks for your work ! :)

from context.

olk avatar olk commented on August 18, 2024

I guess that the memory allcoation/deallocation cosnumes most of the time.
(at my E5-2620 v4 a pure context switch costs 9 cpu cycles)

from context.

matovitch avatar matovitch commented on August 18, 2024

I need to go, but it seems you're right: https://ibb.co/bYbpic.

edit: I am even wondering if there isn't something wrong. There are a lot of allocations.

from context.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.