[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
- <!--x-content-type: text/plain -->
- <!--x-date: Sat Sep 25 09:35:05 2004 -->
- <!--x-from-r13: rfbgrevp ng 3gvzrf25.arg (Urbsserl) -->
- <!--x-message-id: [email protected] -->
- <!--x-reference: Pine.LNX.4.44.0409250804300.14536-[email protected] --> "http://www.w3.org/TR/html4/loose.dtd">
- <!--x-subject: [ale] C++ Debuggery and the Path of Destruction -->
- <li><em>date</em>: Sat Sep 25 09:35:05 2004</li>
- <li><em>from</em>: esoteric at 3times25.net (Geoffrey)</li>
- <li><em>in-reply-to</em>: <[email protected]></li>
- <li><em>references</em>: <[email protected]></li>
- <li><em>subject</em>: [ale] C++ Debuggery and the Path of Destruction</li>
Ah, wanting to learn another hard lesson. :)
>>>The ostensible reason is I am allocating image buffers that are passed on
>>>to an unknown number of asynchronous clients. I store them in a ring that
>>>[hopefully] has enough slots so even a slow client will have time to send
>>>the newest buffer before it is trashed in favor of a yet newer image (4 or
>>>5 down the line). That code is very simple and works fine. The alternative
>>>seemed to be copying each buffer for each client to which it's due, which
>>>I wanted to avoid.
>
>>Wow, some more scary statements. '[hopefully] has enough slots'
>>Really, you should insure that you have enough. One of two solutions,
>>depending on the problem.
>
> ...
> I do this:
>
>>2. finite number of slots needed - static slot allocation.
>
> The number of slots is fixed by a compilation constant. There are tests
> to harmlessly catch an overrun on the ring.
>
> Each slot points to a dynamically allocated byte buffer for whatever size
> image has been returned on that round. These are what I tried not to
> recopy. I ended up with a mix of local and remote buffer allocations,
> which is just a _REAL_Bad_Idea(TM)_; it's going to go, NOW.
:)
--
Until later, Geoffrey Registered Linux User #108567
AT&T Certified UNIX System Programmer - 1995
</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="00850" href="msg00850.html">[ale] C++ Debuggery and the Path of Destruction</a></strong>
<ul><li><em>From:</em> johnmills at speakeasy.net (John Mills)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00850.html">[ale] C++ Debuggery and the Path of Destruction</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00852.html">[ale] C++ Debuggery and the Path of Destruction</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00850.html">[ale] C++ Debuggery and the Path of Destruction</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00847.html">[ale] C++ Debuggery and the Path of Destruction</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00851"><strong>Date</strong></a></li>
<li><a href="threads.html#00851"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>
<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>