Getting number of messages in MessageBox

Gabi galim120 at bezeqint.net
Tue Aug 6 00:18:34 PDT 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?


More information about the Digitalmars-d-learn mailing list