Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

re: Another Threading Question



On Tue, 12 Jun 2007 14:21:30 +0100, Dave <email@hidden> wrote:
> If am using MPCreateTask() to a create a task that is used to process
> a movie file. The results are stored in a big buffer (maybe 20MB in
> size). How can I pass a this buffer from the task I created to the
> creating task?

There's a programming axiom that says that you should always free memory in
the same function that allocates it. Following that I'd advise that you to
allocate the memory in the creating task and pass it to the MP thread
instead;

> Is it ok to use malloc() and just pass the buffer back via a Global?

NO. ;-)

-- 
Enjoy,
George Warner,
Schizophrenic Optimization Scientist
Apple Developer Technical Support (DTS)







 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.