digitalmars.D.learn - Getting number of messages in MessageBox
- Marek Janukowicz (6/6) Aug 05 2013 I'm using std.concurrency message passing and I'd like to check which th...
- =?UTF-8?B?QWxpIMOHZWhyZWxp?= (7/11) Aug 05 2013 Would setMaxMailboxSize() be helpful?
- Marek Janukowicz (7/20) Aug 05 2013 Well, while this could help a little, it's not really what I'm looking f...
- Gabi (3/30) Aug 06 2013 Why not go for the trivial solution - just increase/decrease a
- Marek Janukowicz (7/9) Aug 06 2013 Yeah, that's most likely what I'll end up with, but it's a pity such
- dennis luehring (3/10) Aug 06 2013 the question is do the published counter then needs locking - and make
- Marek Janukowicz (5/7) Aug 06 2013 Good point - but I believe the code operating on the counter is synchron...
- Gabi (5/13) Aug 06 2013 I agree that this is much needed feature.
- Dmitry Olshansky (6/10) Aug 06 2013 This is sadly intentional. The reasons must be due to some efficient
- Sean Kelly (22/32) Aug 06 2013 thread
- Andrej Mitrovic (4/8) Aug 05 2013 I wanted this too, and filed Issue 5806 many months ago:
- Sean Kelly (7/11) Aug 05 2013 thread=20
I'm using std.concurrency message passing and I'd like to check which thread might be a bottleneck. The easiest would be check number of messages piled up for each of them, but I could not find a way to do that. Is it possible? Every detail about MessageBox seems to be hidden... -- Marek Janukowicz
Aug 05 2013
On 08/05/2013 04:18 PM, Marek Janukowicz wrote:I'm using std.concurrency message passing and I'd like to check which thread might be a bottleneck. The easiest would be check number of messages piled up for each of them, but I could not find a way to do that. Is it possible? Every detail about MessageBox seems to be hidden...Would setMaxMailboxSize() be helpful? void setMaxMailboxSize(Tid tid, size_t messages, bool function(Tid) onCrowdingDoThis); You can set a limit (perhaps that is lower than normal operation) and report whenever a particular Tid's MessageBox gets full. Ali
Aug 05 2013
Ali Çehreli wrote:On 08/05/2013 04:18 PM, Marek Janukowicz wrote:Well, while this could help a little, it's not really what I'm looking for. I'd like to dump message counts for various threads periodically and see how it fluctuates over time. With the solution you propose I could only check how often a certain limit is hit. -- Marek JanukowiczI'm using std.concurrency message passing and I'd like to check which thread might be a bottleneck. The easiest would be check number of messages piled up for each of them, but I could not find a way to do that. Is it possible? Every detail about MessageBox seems to be hidden...Would setMaxMailboxSize() be helpful? void setMaxMailboxSize(Tid tid, size_t messages, bool function(Tid) onCrowdingDoThis); You can set a limit (perhaps that is lower than normal operation) and report whenever a particular Tid's MessageBox gets full.
Aug 05 2013
On Tuesday, 6 August 2013 at 06:15:20 UTC, Marek Janukowicz wrote:Ali Çehreli wrote:Why not go for the trivial solution - just increase/decrease a counter for each push/pop message?On 08/05/2013 04:18 PM, Marek Janukowicz wrote:Well, while this could help a little, it's not really what I'm looking for. I'd like to dump message counts for various threads periodically and see how it fluctuates over time. With the solution you propose I could only check how often a certain limit is hit.I'm using std.concurrency message passing and I'd like to check which thread might be a bottleneck. The easiest would be check number of messages piled up for each of them, but I could not find a way to do that. Is it possible? Every detail about MessageBox seems to be hidden...Would setMaxMailboxSize() be helpful? void setMaxMailboxSize(Tid tid, size_t messages, bool function(Tid) onCrowdingDoThis); You can set a limit (perhaps that is lower than normal operation) and report whenever a particular Tid's MessageBox gets full.
Aug 06 2013
Gabi wrote:Why not go for the trivial solution - just increase/decrease a counter for each push/pop message?Yeah, that's most likely what I'll end up with, but it's a pity such information exists and I only can't access it because someone decided to make it private... or should I file a bug (or rather feature request) about it? -- Marek Janukowicz
Aug 06 2013
Am 06.08.2013 09:30, schrieb Marek Janukowicz:Gabi wrote:the question is do the published counter then needs locking - and make it slow for all - just for beeing getable?Why not go for the trivial solution - just increase/decrease a counter for each push/pop message?Yeah, that's most likely what I'll end up with, but it's a pity such information exists and I only can't access it because someone decided to make it private... or should I file a bug (or rather feature request) about it?
Aug 06 2013
dennis luehring wrote:the question is do the published counter then needs locking - and make it slow for all - just for beeing getable?Good point - but I believe the code operating on the counter is synchronized already, so synchronized getter would not really slow things down. -- Marek Janukowicz
Aug 06 2013
On Tuesday, 6 August 2013 at 07:47:10 UTC, Marek Janukowicz wrote:dennis luehring wrote:I agree that this is much needed feature. In python for example, the threaded Queue class has qsize() method that returns the APPROX size of the queue. Without it my life would be much harder-I use it frequently.the question is do the published counter then needs locking - and make it slow for all - just for beeing getable?Good point - but I believe the code operating on the counter is synchronized already, so synchronized getter would not really slow things down.
Aug 06 2013
06-Aug-2013 03:18, Marek Janukowicz пишет:I'm using std.concurrency message passing and I'd like to check which thread might be a bottleneck. The easiest would be check number of messages piled up for each of them, but I could not find a way to do that. Is it possible? Every detail about MessageBox seems to be hidden...This is sadly intentional. The reasons must be due to some efficient concurrent queues not being able to produce reliable item count if at all. However this seems at odds with setMaxMailboxSize ... -- Dmitry Olshansky
Aug 06 2013
On Aug 6, 2013, at 1:27 PM, Dmitry Olshansky <dmitry.olsh gmail.com> = wrote:06-Aug-2013 03:18, Marek Janukowicz =D0=BF=D0=B8=D1=88=D0=B5=D1=82:threadI'm using std.concurrency message passing and I'd like to check which =piledmight be a bottleneck. The easiest would be check number of messages =possible?up for each of them, but I could not find a way to do that. Is it =concurrent queues not being able to produce reliable item count if at = all.Every detail about MessageBox seems to be hidden... =20=20 This is sadly intentional. The reasons must be due to some efficient ==20 However this seems at odds with setMaxMailboxSize ...The lack of a function to get the current mailbox size is mostly an = oversight. It would be easy to return the same message count used by = setMaxMailboxSize. This isn't an exact count, since that would be = inefficient as you say, but it's a reasonable approximation. So I = wouldn't use the returned message count as a pivotal part of a protocol = design, for example, but it would be fine for determining whether a = consumer is being overwhelmed by requests. That said, with the possible exception of setMaxMailboxSize allowing one = thread to affect the behavior of another thread's mailbox, I think the = current functionality should all extend to interprocess messaging = without alteration. I'm not sure that this could be done for a = getMailboxSize call. Certainly not with any semblance of efficiency = anyway. But perhaps it's reasonable to have some subset of = functionality that only works on local threads so long as the core = messaging API doesn't have such limitations.=
Aug 06 2013
On 8/6/13, Marek Janukowicz <marek janukowicz.net> wrote:I'm using std.concurrency message passing and I'd like to check which thread might be a bottleneck. The easiest would be check number of messages piled up for each of them, but I could not find a way to do that. Is it possible? Every detail about MessageBox seems to be hidden...I wanted this too, and filed Issue 5806 many months ago: http://d.puremagic.com/issues/show_bug.cgi?id=5806 Hopefully someone steps up and implements the feature.
Aug 05 2013
On Aug 5, 2013, at 4:18 PM, Marek Janukowicz <marek janukowicz.net> = wrote:I'm using std.concurrency message passing and I'd like to check which =thread=20might be a bottleneck. The easiest would be check number of messages =piled=20up for each of them, but I could not find a way to do that. Is it =possible?=20Every detail about MessageBox seems to be hidden...Not currently. It wouldn't be hard to add a function to get the count = used by setMaxMailboxSize though. I'll make a note to add it.=
Aug 05 2013