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 13 Jun 2007, at 15:15, George Warner wrote:

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

Yes, I always try and do that, but it's not always possible when you take old software into consideration. I'm trying to write a plug-in that uses an older host application and unfortunately I therefore bound by the way it's structured.


instead;

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

NO. ;-)


So, what method would you recommend instead?

All the Best
Dave

--
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
References: 
 >re: Another Threading Question (From: George Warner <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.