Jump to page: 1 2
Thread overview
Getting number of messages in MessageBox
Aug 05, 2013
Marek Janukowicz
Aug 06, 2013
Ali Çehreli
Aug 06, 2013
Marek Janukowicz
Aug 06, 2013
Gabi
Aug 06, 2013
Marek Janukowicz
Aug 06, 2013
dennis luehring
Aug 06, 2013
Marek Janukowicz
Aug 06, 2013
Gabi
Aug 06, 2013
Dmitry Olshansky
Aug 10, 2013
Sean Kelly
Aug 10, 2013
Andrej Mitrovic
Aug 10, 2013
Sean Kelly
August 05, 2013
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
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
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
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
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
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
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
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
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
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.
« First   ‹ Prev
1 2