- Recursive spinlock - 12 Updates
- 944 FPS - 2 Updates
- Custom allocator not working with gcc - 2 Updates
- neoGFX animation is as simple as... - 1 Update
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: May 11 06:17PM +0200 On 11.05.2020 15:50, Bonita Montero wrote: >> auto getNextDelay = []( vector<uint64_t> delayVector, size_t >> iDelay ) -> size_t > OMG, does someone guess what's the mistake here ? ;-) Passing a vector by value, forgetting `const`, using unsigned type for number. - Alf |
Bonita Montero <Bonita.Montero@gmail.com>: May 11 06:26PM +0200 >>> iDelay ) -> size_t >> OMG, does someone guess what's the mistake here ? ;-) > Passing a vector by value, ... This was the issue. > ... forgetting `const`, ... That's what I later inserted, but I think it's not really necessary. > using unsigned type for number. No, size_t was correct. |
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: May 11 08:24PM +0200 On 11.05.2020 18:26, Bonita Montero wrote: > That's what I later inserted, but I think it's not really necessary. >> using unsigned type for number. > No, size_t was correct. Consider defining using Size = ptrdiff_t; ... and using that instead of `size_t`. E.g., by default `std::distance` returns a `ptrdiff_t`. A main advantage is that you avoid unintended implicit conversions from signed to unsigned value, with possible wrap-around. Relevant part of the C++ code guidelines: <url: https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#arithmetic>. - Alf |
Bonita Montero <Bonita.Montero@gmail.com>: May 11 08:31PM +0200 > Consider defining > using Size = ptrdiff_t; > ... and using that instead of `size_t`. std::vector::operator [] uses size_t as the index so I use it also. There's absolutely no need for negative indices here. But in the latest code I changed to iterators. |
"Öö Tiib" <ootiib@hot.ee>: May 11 11:51AM -0700 On Monday, 11 May 2020 17:46:19 UTC+3, Bonita Montero wrote: > Why have this mutexes _static_ spin-counts at initilzation ? > But maybe you could convince me by naming a source for your wild > assumptions. But it would be unrealistic to exptect you could. Kaz Kylheku who originally invented that PTHREAD_MUTEX_ADAPTIVE_NP has said that it has spin count adjusted by such estimator. Why should he lie? |
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: May 11 01:06PM -0700 On 5/11/2020 5:13 AM, Bonita Montero wrote: > > of its groundlessness ... nothing to argue there. > What I said isn't nonsense. > The "benefits" of adaptive locks have never been verified in practice. Do you think that an OS designer would add them in for no reason whatsoever? Most OS's use hybrid adaptive locking for their general purpose locks. |
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: May 11 01:12PM -0700 On 5/11/2020 11:51 AM, Öö Tiib wrote: > Kaz Kylheku who originally invented that PTHREAD_MUTEX_ADAPTIVE_NP has > said that it has spin count adjusted by such estimator. Why should > he lie? Bonita is having some trouble understanding what can be done. Iirc, Kaz used to post on comp.programming.threads. It is now a wasteland! Btw, Bonita. Please implement your code using a race detector, it will find your bugs. Try Relacy... |
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: May 11 01:24PM -0700 On 5/11/2020 1:06 PM, Chris M. Thomasson wrote: > Do you think that an OS designer would add them in for no reason > whatsoever? > Most OS's use hybrid adaptive locking for their general purpose locks. Fwiw, have you ever heard of asymmetric locking? This can even remove memory barriers for the fast path, to make it hyper fast... ;^) Think of an asymmetric Dekker algorihtm. Take the two process version with a usage pattern where process A takes the lock _much_ more frequently than process B. Therefore, we can heavily optimize process A. The fun part is that Windows has an essential function called FlushProcessWriteBuffers that makes it possible to implement. https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-flushprocesswritebuffers This allows for a sort of "remote" memory barrier. The slow path, process B would execute this instruction. Process A does not need to use any membars. It makes things faster. The usage pattern means that calls to FlushProcessWriteBuffers will not be frequent. |
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: May 11 01:29PM -0700 On 5/10/2020 8:04 AM, Bonita Montero wrote: >> often. > Then spinning succeeds only when it is begun shortly before the other > thread releases the mutex, and that's very unlikely. You need to separate the work performed under the critical section, vs the usage pattern of the mutex. They are separate things. Even if the critical section is short, it can still be hammered by a bunch of threads for sustained periods of time. This will create contention. |
Ian Collins <ian-news@hotmail.com>: May 12 08:43AM +1200 On 11/05/2020 22:44, Öö Tiib wrote: >> Write me a benchmark to prove your assumptions. > Why should I write you benchmarks when you post groundless > bullshit? Benchmarks written by me can't cure your stupidity. There be trolls... -- Ian. |
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: May 11 01:48PM -0700 On 5/11/2020 1:43 PM, Ian Collins wrote: >> Why should I write you benchmarks when you post groundless >> bullshit? Benchmarks written by me can't cure your stupidity. > There be trolls... Are some trolls smarter than others? Is the size of the bridge or where its located? |
Keith Thompson <Keith.S.Thompson+u@gmail.com>: May 11 02:40PM -0700 > Why should I argue when there is only groundless nonsense? > Nonsense without ground should be dismissed on the ground > of its groundlessness ... nothing to argue there. No, you shouldn't argue. But I suggest that a better way not to argue is simply not to reply. Please stop feeding the troll. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com Working, but not speaking, for Philips Healthcare void Void(void) { Void(); } /* The recursive call of the void */ |
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: May 11 01:47PM -0700 On 5/8/2020 2:18 PM, Mr Flibble wrote: > neoGFX achieves 944 FPS: > https://camo.githubusercontent.com/d32e8fabf762b33adbf4f18f447f3530b9b66fd6/687474703a2f2f6e656f6766782e6f72672f74656d702f6c6f6c2e706e673f69643d31 When you get some really free time, can you implement the following shader in your system, without a throttle, and tell me the fps? Fwiw, here is an example of running my experimental vector field in a shader without having to create an array of field points. This creates the points on the fly, in real time: https://www.shadertoy.com/view/3dffDX Can you see this animation on your end? It should get 60 fps... |
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: May 11 10:36PM +0100 On 11/05/2020 21:47, Chris M. Thomasson wrote: > Fwiw, here is an example of running my experimental vector field in a shader without having to create an array of field points. This creates the points on the fly, in real time: > https://www.shadertoy.com/view/3dffDX > Can you see this animation on your end? It should get 60 fps... I have very little free time these days even during the COVID-19 lockdown (which doesn't really change things for a programmer). :D /Flibble -- "Snakes didn't evolve, instead talking snakes with legs changed into snakes." - Rick C. Hodgin "You won't burn in hell. But be nice anyway." – Ricky Gervais "I see Atheists are fighting and killing each other again, over who doesn't believe in any God the most. Oh, no..wait.. that never happens." – Ricky Gervais "Suppose it's all true, and you walk up to the pearly gates, and are confronted by God," Byrne asked on his show The Meaning of Life. "What will Stephen Fry say to him, her, or it?" "I'd say, bone cancer in children? What's that about?" Fry replied. "How dare you? How dare you create a world to which there is such misery that is not our fault. It's not right, it's utterly, utterly evil." "Why should I respect a capricious, mean-minded, stupid God who creates a world that is so full of injustice and pain. That's what I would say." |
Juha Nieminen <nospam@thanks.invalid>: May 11 06:27PM > Point out where you actually gave me some useful help and I might feel upset > about that - its still not working on gcc despite trying various suggestions > from here. But it works here, so I don't care. Right back at you. |
Ian Collins <ian-news@hotmail.com>: May 12 08:42AM +1200 > You posted 2 changes, not 3 (unless you count your nonsense about not mixing > iostreams with stdio). And no, it doesn't compile on gcc never mind run. I > suggest you try it first next time. Oh dear.. b.cc is your code with my suggested fixes, b-original.cc is your code as posted: $ diff b.cc b-original.cc 13c13 < class myallocator --- > class myallocator: public allocator<T> 16,18c16 < using value_type = T; < < T *allocate(size_t cnt) --- > T *allocate(size_t cnt, const void *hint=0) If you look really carefully you will see three changes there. $ g++ -std=c++11 b.cc && ./a.out Creating vector... Allocating 1 instances, 4 bytes Pointer = 94319169221248 Allocating 2 instances, 8 bytes Pointer = 94319169221280 Deallocating pointer 94319169221248 Allocating 4 instances, 16 bytes Pointer = 94319169221248 Deallocating pointer 94319169221280 ----- Creating string... Appending string... Allocating 31 instances, 31 bytes Pointer = 94319169221312 End Deallocating pointer 94319169221312 Deallocating pointer 94319169221248 This appears to both compile and run. -- Ian. |
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: May 11 09:25PM +0100 auto const explosionMaterial = ng::game::material { {}, {}, ecs.shared_component<ng::game::texture>().populate("explosion", ng::to_ecs_component(ng::image{ ":/test/resources/explosion.png" })) }; auto const explosionAnimation = ng::game::animation_filter { ecs.shared_component<ng::game::animation>().populate("explosion", ng::game::regular_sprite_sheet_to_animation(explosionMaterial, ng::vec2u32{ 4u, 3u }, 0.1)) }; auto explosion = ecs.create_entity(archetypes::explosion, explosionMaterial, explosionAnimation); /Flibble -- "Snakes didn't evolve, instead talking snakes with legs changed into snakes." - Rick C. Hodgin "You won't burn in hell. But be nice anyway." – Ricky Gervais "I see Atheists are fighting and killing each other again, over who doesn't believe in any God the most. Oh, no..wait.. that never happens." – Ricky Gervais "Suppose it's all true, and you walk up to the pearly gates, and are confronted by God," Byrne asked on his show The Meaning of Life. "What will Stephen Fry say to him, her, or it?" "I'd say, bone cancer in children? What's that about?" Fry replied. "How dare you? How dare you create a world to which there is such misery that is not our fault. It's not right, it's utterly, utterly evil." "Why should I respect a capricious, mean-minded, stupid God who creates a world that is so full of injustice and pain. That's what I would say." |
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page. To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com. |
No comments:
Post a Comment