Thread overview | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
August 05, 2013 Getting number of messages in MessageBox | ||||
---|---|---|---|---|
| ||||
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
|
August 06, 2013 Re: Getting number of messages in MessageBox | ||||
---|---|---|---|---|
| ||||
Posted in reply to Marek Janukowicz | 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
|
August 06, 2013 Re: Getting number of messages in MessageBox | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ali Çehreli | Ali Çehreli wrote: > 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. 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 Janukowicz |
August 06, 2013 Re: Getting number of messages in MessageBox | ||||
---|---|---|---|---|
| ||||
Posted in reply to Marek Janukowicz | On Tuesday, 6 August 2013 at 06:15:20 UTC, Marek Janukowicz wrote:
> Ali Çehreli wrote:
>
>> 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.
>
> 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.
Why not go for the trivial solution - just increase/decrease a counter for each push/pop message?
|
August 06, 2013 Re: Getting number of messages in MessageBox | ||||
---|---|---|---|---|
| ||||
Posted in reply to Gabi | 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 |
August 06, 2013 Re: Getting number of messages in MessageBox | ||||
---|---|---|---|---|
| ||||
Posted in reply to Marek Janukowicz | Am 06.08.2013 09:30, schrieb Marek Janukowicz:
> 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?
the question is do the published counter then needs locking - and make it slow for all - just for beeing getable?
|
August 06, 2013 Re: Getting number of messages in MessageBox | ||||
---|---|---|---|---|
| ||||
Posted in reply to dennis luehring | 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 |
August 06, 2013 Re: Getting number of messages in MessageBox | ||||
---|---|---|---|---|
| ||||
Posted in reply to Marek Janukowicz | On Tuesday, 6 August 2013 at 07:47:10 UTC, Marek Janukowicz wrote:
> 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.
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.
|
August 06, 2013 Re: Getting number of messages in MessageBox | ||||
---|---|---|---|---|
| ||||
Posted in reply to Marek Janukowicz | 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 |
August 10, 2013 Re: Getting number of messages in MessageBox | ||||
---|---|---|---|---|
| ||||
Posted in reply to Marek Janukowicz | 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. |
Copyright © 1999-2021 by the D Language Foundation