From: Pascal J. Bourguignon on
"Joe" <Joe(a)NoSpammers.Com> writes:
> Ok, maybe I should have been more specific. The assumption here is
> that pIn and pOut are pointing to arrays which are not overlapped by
> any other arrays. And just to clarify, foo() does not use any global
> variables.
>
> For example:
>
> In thread #1 two local buffers are defined and the thread calls foo with
> pIn pointing to one of the local buffers; and pOut pointing to the
> other local buffer.
>
> In thread #2 two local buffers are defined and the thread calls foo with
> pIn pointing to one of the local buffers; and pOut pointing to the
> other local buffer.
>
> So to iterate my question and based on the above-mentioned assumption:
>
> If I have two or more threads executing and these threads use foo, are
> there any risks that something might go wrong; like the output being
> screwed up and deviating from what is expected?

Each thread has its one stack, and automatic variables are allocated
on the stack.


--
__Pascal Bourguignon__ http://www.informatimago.com/
From: David Schwartz on
On Jun 2, 10:38 am, "Joe" <J...(a)NoSpammers.Com> wrote:

> If I have two or more threads executing and these threads use foo, are
> there any risks that something might go wrong; like the output being
> screwed up and deviating from what is expected?

So long as one thread does not modify a resource while another thread
is or might be accessing it, there is no problem.

DS