« first day (839 days earlier)      last day (4335 days later) » 

12:02
Arbitrary size heaps?
Xeo
Xeo
"Depends on how you capture your variables. If you capture them by reference ([&]) and they go out of scope, the references will be invalid, just like normal references.": Why is this allowed in the first place then? — Giorgio 16 mins ago
Wat.
@R.MartinhoFernandes wat's dat?
@DeadMG Like the normal allocators that allow allocations of any size.
right, but how is that effectively different to just using one arbitrary size heap?
I wasn't suggesting it. I was asking if that was what you were talking about.
12:05
oh, right
no, I mean, creating several different independent heaps to allocate from/to.
@R.MartinhoFernandes your relentless propaganda has just resulted in 1 more follower for @historyweird
Multiple memory heaps would still require synchronized access, else objects could not be safely communcated between threads.
Unsynchronized access to the heap not objects
@MartinJames eh? The heap doesn't care who sees or manipulates the object
12:17
@MartinJames The safety of objects placed in memory is irrelevant as to where that memory is.
@jalf It does if objects are to be relased back to that heap from multiple threads.
@MartinJames What I'm suggesting is that they serve no purpose except in a situation which is explicitly not that one.
@DeadMG OK, yes.
@CatPlusPlus You have never dynamically allocated an object instance?
12:22
What are you on about
No avatar.
@MartinJames yes, but that has nothing to do with "communicating objects between threads"
The idea is to have multiple independent heaps that threads DON'T share
@jalf Well, it is a fairly common way of communicating data between threads!
Xeo
Xeo
Awesome, posting the comment freed me from the responsibility to reeducate that guy.
12:24
hmmm
@CatPlusPlus If the data does not have to be shared between threads, may as well stack them.
it's actually surprisingly difficult to specify the difference between a heap and an object pool, because it's almost all implementation details.
Object pools are special case of heaps
@MartinJames Stacks have limited size
Object pools I do use often. Multiple independent arbitrary heaps I do not, (yet).
Also data shouldn't be shared between threads by default
12:26
@MartinJames by destroying objects on another thread than it was created on? That should never be common
@CatPlusPlus Right, I got that far.
but aside from the fact that I have named them different types, I've got little to show for how an object pool should be different to a heap.
Object pools usually throw away heap bookkeeping in favour of limiting themselves to a single type (where size is constant)
right
In a normal heap you have different space management
but because you don't know the type in advance
12:28
@CatPlusPlus Yes, that's what I understand by 'object pool'.
you have to offer a fairly generic interfac
e
@DeadMG Then you need more bookkeeping
@CatPlusPlus Yeah. I don't think it'll be a problem, Boost does fine with it.
@jalf There is not a great deal of alternative. Returning passed objects back to a pool is one, though it's been argued that this is just a special case of multiple heaps :(
Also free space merging and stuff
12:30
it's just describing the intended difference which is difficult, because virtually the only interface difference is in performance, which you can't exactly Standardise.
If size is constant then objects always fit the holes
What are you standardising
I'm writing a proposal to add object pool and a few other allocators.
Aahahahaha spam is so clever
I only use object pools for large and/or complex objects, eg. network data buffers and socket contexts.
> Dear Legnica I am William Togla,personal represantative to Late Mr.Jan Legnica, a national of your country, and the chief executive officer of Jan Construction Company here in Benin Republic West Africa.
Xeo
Xeo
12:31
@jalf: That guy doesn't seem to want to understand.
@MartinJames Object pools are typically used for really small objects of which you have a lot
There's really no point in pooling large objects
Especially if you have one or two
This is what I will e-mail to Scott Meyers pastebin.com/Bfnni1x6 unless someone finds a silly mistake. Feedback please :) Now lunch.
"I am e-mailing" sounds silly
Xeo
Xeo
@R.MartinhoFernandes > this advice to be the wrong advice
Sound weird.
I'd like to talk about
It really sounds forced-formal
12:34
Anyone here has coded a Bluetooth application? I need to know, do you self-create the UUID for a secure/inscure connection between two Bluetooth devices?
Xeo
Xeo
> them in the form a dialog /cc @R.MartinhoFernandes
of a
"The particular piece of advice I am concerned with is the following." is redundant, just put a colon after the previous one and then the quote
@R.MartinhoFernandes I think it's a little too shared_ptr specific- the same arguments, essentially, apply to any smart pointer, although slightly more to shared_ptr because of the nasty copy but free move.
I also think it's way too formal
but the content is pretty good
Formality must die
@CatPlusPlus Emirically, the performance of my server improved by some 30% after I incorporated an array of object pools of varying sizes for buffering. The buffers were quite large, (4k, 8k, 16k.. up to 256k).
12:39
@tom_mai78101 Does the UUID string of code of a Bluetooth app needs to be created by the developers themselves?
you asked yourself a question...
now will you answer it?
@TonyTheLion I have split personality. I can't answer a problem my other self asked. :(
Xeo
Xeo
@R.MartinhoFernandes Lol, "Mit freundlichen Grüßen".
Booched it: meant to delete :)
12:55
> As I explain in my Stack Overflow post, when you want to share ownership, passing by value is better. It has the advantage of declaring that ownership is shared directly in the interface, and I think it has no significant disadvantages
@R.MartinhoFernandes Without thinking about this too much, ^ isn't there a (marginal) use case where you'd want to work with forward declared types. Nah, forget it. Brainfart. The contained type is a pointer anyway. Sry to bother
@DeadMG Oh and I don't think it's too formal. I think, however, that the introduction could be reduced (by a large factor). The guy knows who you are. I'd just say why you think it relevant to him, then invite him to read that answer.
agree
If a bit verbose, I think the whole story is pretty clear. That is important. The gamble here is, will Scott take the time to read his mail? If he does, he'll not have to worry about interpreting fuzzy claims: it's all right there. Nice.
he will
look at the comments, he responds to most of them, and pretty promptly too.
@sehe Bits like "It is my hope" feel extremely formal
And formal style is shitty and forced
It needs to die
Ok, thanks guys. I cut up a bit on the intro, fixed a few typos, and sent it.
@Xeo Erm, yeah, that's the signature that Thunderbird drops in. I changed that too.
[&i](int i) { return allocateVector (i);} does this use the captured variable, or the argument?
Xeo
Xeo
13:09
error?
OP says it compiles.
argument
Xeo
Xeo
Hm, yeah, the parameter of operator() is more local
Xeo
Xeo
The fuck
That's kinda unexpected.
13:11
Clang says 0, though.
I wouldn't call it unexpected.
Captured variables should be treated like outer scope
Xeo
Xeo
Hm.. that part may be underspecified in the standard.
Whatever the standard says, I should at least be warned. (not GCC's accidental warning; a proper one)
13:13
what ever the OP said, they are wrong
that's why they're OP, no?
> when dynamically pointing to one of the functions of IndexScan behaves abruptly.
so, looking at the bright side, I no longer have to mess around with IE6 and I now get valuable experience with windbg and debugging crash dumps!
room topic changed to Lounge<C++>: We behave abruptly. [c++] [c++11] [c++-faq] [get-out] [no-pointers] [no-questions] [no-singletons] [no-topic]
@jalf Sounds like the perfect birthday.
13:27
did anyone say glass half full? :D
Will there be cake?
also what the fuck
Has anyone seen Zero Dark Thirty yet?
I hope my debugger is lying to me
So the cake is a lie?
13:29
It's telling me the process had exactly one thread, and main or winmain is nowhere in its call stack
Ooops.
Maybe it crashed on static cleanup?
nah, the process starts ok. it shows its window and everything just fine. The crash happens later
Yeah... static cleanup also happens later.
I mean, destructors of static objects.
yeah, when the process is supposed to terminate. Which it isn't
When those run, main is over, right?
13:32
so if that happens, then something else already went wrong, causing it to terminate prematurely
hmm
I think that std::bad_alloc should be cut.
this calls for a cup of tea
@DeadMG Good luck with that
heh, true true :P
hmmm
to offer serialized and concurrent access to arena, or separate arena and serialized_arena classes?
@Xeo I'd say it is wrong. I remember reading the specs of lambda as a set of transformations to a local type with certain operator() and stuff. Of course, compilers needn't actually do all that (as-if rule) but the semantics should be predictable with that model, no?
hmmm
maybe instead of PornTony, I should mentally rename you GifTony
lol
@DeadMG is that my alias?
Xeo
Xeo
13:41
@sehe Well, it also has to transform the name of captured variables inside the lambda body so they refer to the lambda's members.
using PornTony = Tony;/
2
I ran my game for first time after doing alot of tweaks, and MSVS itself is throwing me TONS of "unhandled exceptions", no idea what I should do?
"std::overflow_error" for example
You should fix the overflows.
Maybe.
Xeo
Xeo
You tweaked your game into being broken, it seems.
@TonyTheLion We're officially humour incompatible. When it comes to memey vids, then
13:41
but how does the std container overflow?
@GigaBass test your code after each of the tweaks?
It's supposed to expand as I add stuff... right?
@sehe lol
It were tweaks I couldn't do little by little ;_;
How do I know WHERE it's overflowing?
@GigaBass that depends on how you add stuff, and which container
Xeo
Xeo
13:42
Honestly, I have no fucking clue which standard part even throws std::overflow_error.
On the edges
Because I can't even get to the debugger
@Xeo precisely. And members would be less local than params, which leads to the expectation that the parameter would be used, instead of the captured reference
I've only used <vector> with push_back
Xeo
Xeo
@sehe Expectation, yeah. That's what I said.
@GigaBass That can't ever throw overflow_error, IIRC.
13:43
@GigaBass you know, you can't make excuses to the debugger. Saying "but I couldn't have done it any other way" doesn't magically fix your program. :)
@Xeo Sorry. I thought you disagreed.
Dafuq why does no one disagree
and telling us that nothing in your code should cause that (or any) error doesn't really help you find the problem either
@sehe I'll do it. I don't know what we're talking about, but I'll gladly disagree on general principles
If I could debug without msvs going apeshit ;_;
@GigaBass Ctrl+Alt+E and enable breaks on std::exception.
Xeo
Xeo
@sehe To what? I said it was unexpected that the capture was chosen.
And also, Clang says the parameter is chosen.
Robot, ask a question on SO.
13:45
@Xeo And I volunteered that it was more than that: I think it's wrong
@Xeo Woof
@sehe That's my line, you beary bastard.
I don't think either is unexpected. When I saw it I just assumed nothing and expected everything.
Thanks @sehe
@Xeo Anyways it was the other response that I thought meant you disagreed (the one starting "Well, it also has to"... )
@DeadMG *beardy
@R.MartinhoFernandes struct std::missing_expectation_failure : std::expectation_failure { ... };
None.🍌🍌🍌🍌🍌 — R. Martinho Fernandes 17 secs ago
TIL SO comments have a minimum of 15 UTF-16 code units.
13:47
of course they do
nooby .NET and its code-unit approaches.
@DeadMG The JS does it too, it seems.
nooby JS and its... well, everything.
Also, bananas are a better filler than invisible separators.
@DeadMG is .NET bad for Unicode?
@R.MartinhoFernandes More nutritional value
@sehe Eh. It's not baaaaad, but it could be a lot better.
13:49
@DeadMG Nooby puppy and its lousy English.
they, like Java, basically went UCS-2, I believe, and then got a nasty surprise when it turned into UTF-16.
@R.MartinhoFernandes You don't know what the elision was for
@DeadMG No, .NET started UTF-16. I assume for Windows easiness.
@R.MartinhoFernandes Nooby robot and its insufficient waiting for edit window to elapse.
> I think that a good logger should always provide a near constant execution time in any circumstance, which is problematic when threads might have to wait for mutexes to be released. However, in practice, unless numerous threads are logging, the operations are fast enough that there is no significant delay.
^ famous last words here
13:50
@R.MartinhoFernandes Huh, that surprises me. Their API is very UCS-2, last I checked.
like, they don't have codepoint properties, they seem to have codeunit properties.
@DeadMG It has all the tools needed in System.String and System.Char and System.Encoding.* and System.Globalization.* and ... actually, the damn things are spread all over the place and named terribly and yeah, it's fucking annoying. But it even has grapheme cluster iteration in one of those namespaces with a terrible name.
not bad, then
Ah, System.Globalization.StringInfo.GetTextElementEnumerator is the grapheme cluster stuff.
But yes, it's sub-par to have that "hidden".
And these are the methods to get code point properties: msdn.microsoft.com/en-us/library/k43c6164.aspx
it keeps breaking @ end of a throw.cpp file... lol
@DeadMG If memory serves, .NET started out around the same time they'd realized Windows needed to convert from UCS-2 to UTF-16, so it was probably never actually UCS-2, but they also lacked any real experience with UTF-16 at the time, so a fair amount of it (especially the older parts) probably look/feel a lot like UCS-2 anyway.
14:00
How can I start the debug and go up to the point BEFORE it goes all weird, aka the point in MY CODE
Call stack window.
Ahhh there we go, thanks

Unicode in .NET - quick summary

15 mins ago, 11 minutes total – 24 messages, 3 users, 0 stars

Bookmarked 3 secs ago by sehe

^ not bad for reference purpoises
@JerryCoffin Most of the highly visible parts of the API are UCS-2 :(
porpoises?
14:04
@MartinJames dolphins -- "reference dolphins"
In a few words, it's a decently featured but poor API.
@R.MartinhoFernandes In even fewer words, "It's Microsoft".
3
@MartinJames uxectly. sadly was too busy to edit that
@JerryCoffin Zing
System.Globalization.StringInfo.GetTextElementEnumerator is really crappy: it gives an enumerator, not an enumerable, meaning it cannot be used directly in foreach.
It's a very noobish failure.
dafuq is going on here?
14:10
@sehe Honest truth. Their APIs in general will let you do nearly anything you need -- but doing it is often extremely clumsy. This is a decided contrast to Apple (for one obvious example) where doing what they think you should is easy, and doing anything else is (essentially) impossible.
@R.MartinhoFernandes it smells like something they didn't intend to expose from the get-go. Also, you can always you this piece of art
a lion is out of touch
nothing out of the ordinary
shush
you silly polar bear
ad hominem ursum
@sehe Meh, I prefer a four line iterator function pair :P.
14:15
@R.MartinhoFernandes j/k
(And for multithreaded access IParallelEnumerable is betterz).
@R.MartinhoFernandes I think it wasn't officially available when I wrote that answer.
Actually, it appears none of the answers there uses the wrapper-worker pattern for implementing iterators.
That's sad.
@R.MartinhoFernandes There was virtually no requirement stated in the Q. In fact, my answer was completely overblown and must indicate I was bored at the time
Your answer does not suffer from that issue. It uses the enumerator in the ctor.
If you pass null to the single function iterators, they will return successfully.
And then, when you start iterating, bam NRE.
It should be a function that tests the argument for null, and then delegates to the function that does the actual iteration. Like all standard LINQ operators are. Fail fast.
Option Mnemonics: tar xzvf = Xtract Ze Vucking Files [said in thick German accent]
Xeo
Xeo
14:25
lol
I don't have trouble with tar flags, but don't ask me to use the much simpler ln without the manual.
@R.MartinhoFernandes workerwrapper.com <-- succeeds at seriously confounding my sleepdeprived mind
@R.MartinhoFernandes yeah. tar is fine by me. ln - well I know the few options I care about. But I do always doublecheck the result when I symlink a directory to replace an existing symlink (I think that's ln -sfvd source/ target
Electronic sports (eSports) comprises the competitive play of video games. Other terms include competitive gaming, professional gaming, e-sport, and cybersport. The most common video game genres associated with electronic sports are real-time strategy (RTS), fighting, first-person shooter (FPS), massively-multiplayer online (MMOG), and racing. Games are played competitively at amateur, semi-professional and professional levels, and some games have organized competition in the form of leagues and tournaments. Events such as Major League Gaming (MLG), Global Starcraft II League (GSL), World...
TIL
this is a thing
Xeo
Xeo
@TonyTheLion Really? Woah.
@sehe I may have used an uncommon name. Jon describes the issue here: msmvps.com/blogs/jon_skeet/archive/2010/09/03/…
14:29
27 secs ago, by Jerry Coffin
@sehe Simpler than they make it sound. You have a wrapper that's devoted to nothing but checking arguments, and a worker that does the work, but is only ever invoked if the wrapper says the arguments are all right.
thanks, Jeffry. That confirmed my suspicion
@Xeo I'm not much of a gamer
Basically, you want some immediate and some deferred execution and you can't have both in the same function.
@TonyTheLion I am not much of an astronaut, but I know spacecraft exist.
@R.MartinhoFernandes That's an important part. I think haskell.org/haskellwiki/Worker_wrapper clearly implies that the wrapper could do more than argument checking (it can also inject starting state; I use this often for algorithm functions)
@R.MartinhoFernandes your point being?
@TonyTheLion Not being much of a gamer doesn't imply you would not know of eSports.
14:32
He's not much of a sporter, either
You can know stuff from the outside.
Yes, but I have not heard of that term before.
I've heard of the concept, but this term, eSports, is new to me
Also, I'm sorry that I haven't indexed the Internet yet.
Xeo
Xeo
TIL the push_front functionality in AS3 (Flash) is called unshift.
unlike you, Robot, I'm merely human.
@Xeo huh?
Xeo
Xeo
?
Xeo
Xeo
!
Wow, the PHP folks now have a room dedicate to close vote requests.
@skaffman and that link clearly confirms we're talking about micro optimizations here ("generates smaller bytecode and might help the jit"). Yet we are talking about code that uses synchronization primitives that may block. I'm willing to bet a profiler would not confirm a net win here. (Premature Optimization) — sehe 30 secs ago
^ poor javans. Eternally confundled
javass
> Our clients include Google, YouTube, News International, PayPal and other agencies such as BBH and Mother.
Mother?
I didn't know she was a client of them.
:P
14:40
@TonyTheLion I think she thinks of it as them being her clients. Anyways...
Any wndbg gurus around?
*ducks*
@sehe ow.
@jalf I've toyed around with it.
14:40
You know, "gdb for windows". (ruffly)
You mean WinDbg?
is it possible to make it break on thread exit?
Windows isn't case sensitive
Hell, windows isn't very sensitive at all
@CatPlusPlus yes
@CatPlusPlus I'm sure that's what he means
14:41
you know
Nope
I've noticed recently that I have a propensity to define really minimal interfaces.
@sehe Missing i
@DeadMG isn't that a good thing?
probably
it's just curious
14:42
@jalf Does this help?
@CatPlusPlus I don't get it. "Heil" is with a single `l` if that's what you are referring to
@TonyTheLion not really. It says how to make a breakpoint apply only to a single thread, but I just want to be notified any time a thread terminates
@TonyTheLion I shan't think so.
@sehe I wonder why the JIT can't do that already, since it's a pretty straightforward transformation, and incredibly easy to detect.
regardless of reason
14:44
Set a breakpoint on ThreadExit?
@DeadMG That's good.
@R.MartinhoFernandes It can't because there might be a race on the lock field? The field isn't final (I think java doesn't have that for instance fields... ICBWT)
@sehe It's final.
And if it isn't, that should be the "optimisation" you make.
@sehe It has.
A non-final field for locking is not sane.
@R.MartinhoFernandes Obviously. I assumed they weren't all talking out of their arses, and final fields weren't achievable.
@R.MartinhoFernandes Indeed. private readonly object _lockfield = new object(); in C#
why would you ever assume that any number of Java programmers were not talking out of their arses?
14:46
It's mentioned in the question :|
@DeadMG Because I'm respectful like that
Hell, even javac can do this optimisation before the JIT.
@R.MartinhoFernandes That looked like possibly sloppy wording to me. Anyways:
> As of Java 5, one particular use of the final keyword is a very important and often overlooked weapon in your concurrency armoury Thread-safety with the Java final keyword
^ final fields may have been impopular for VM compatibility reasons
Well, I know that when I write Java I slap final everywhere.
@R.MartinhoFernandes That's what I've always done. Once a C++ programmer...
14:49
Like in several other languages, it should have been the default, but...
I should probably leave this chat. It's close to my manga night reading time.
@R.MartinhoFernandes The spirit is strong...
> When the sentence "The spirit is willing, but the flesh is weak" (дух бодр, плоть же немощна, an allusion to Mark 14:38) was translated into Russian and then back to English, the result was "The vodka is good, but the meat is rotten" (спирт, конечно, готов, но мясо протухло)
@jalf This comment stackoverflow.com/questions/2797366/… suggests it is possible but does not explain how.
out!
(see, I'm preferring minimal interfacing too now)
3
A: How to know who kills my threads

Chris SchmichA potential way to get more information: attach a debugger and break on thread termination. Depending on how your thread is being terminated, this might not work. Download Debugging Tools for Windows if you don't already have it Run windbg.exe, attach to your process Break into windbg, type sx...

Does this work?
14:52
@sehe Say hi to @DeadMG for me. Bye!
@R.MartinhoFernandes This page describes it: Controlling Exceptions and Events /cc @jalf
So, sxe et it is, apparently
I'm sure puppy gives a fuck.
@R.MartinhoFernandes This page says otherwise:
> On Sat, Jan 22, 2011 at 04:55, Rémi Forax <forax@...> wrote: No, making the local final doesn't trigger any optimization. javac doesn't do any optimization and in the bytecode there is no way to say this local variable is final.
@sehe I used "can" in the sense of "is possible", not the sense of "knows how".
Fuck English.
Also, German, since it has the same duality of meaning in "können".
@sehe Also, the final thing should be the member, not the local.

« first day (839 days earlier)      last day (4335 days later) »