On 27/01/2005 11:58 Pm, Haroon Sheikh wrote:
> From the quartz team's perpective, one should not be sharing a single
> CGContextRef across multiple threads. In general create a new CG object
> for each thread and not share it across multiple thread. That's is the
> supported model. Anything else and you are asking for trouble.
FWIW, I don't see synchronization calls while tracing CGContextScaleCTM
on Jaguar.
Mike
> On Jan 27, 2005, at 9:34 AM, Mike Kluev wrote:
>
>> On 27/01/2005 08:04 Pm, George Warner wrote:
>>> on 1/27/05 3:35 AM, Mike Kluev at <email@hidden> wrote:
>>>> On Wed, 26 Jan 2005 09:26:42, George Warner <email@hidden> wrote:
>>>>> Actually, you can do this. As long as the area's being drawn to by
>>>>> the
>>>>> different thread don't overlap then Quartz can handle the same
>>>>> context being
>>>>> used my multiple threads. Internally it serializes accesses to the
>>>>> context.
>>>> George, I am curious if such internal serialization is really needed
>>>> if areas being drawn don't overlap.
>>> Absolutely. One thread could call:
>>> CGContextScaleCTM(context, 1.0f, -1.0f);
>>> And the other:
>>> CGContextScaleCTM(context, 3.0f, 1.0f);
>>> If they're both using the same context then which ever one executes
>>> last
>>> will effect drawing in the other thread. Something isn't going to look
>>> right.
>>> Note however that the internal serialization doesn't prevent messed up
>>> drawing in that other thread. But it does prevent crashes caused by
>>> non-reentrant code.
>>> Assuming that both threads are using the same Scale, transform, etc.
>>> then
>>> one thread drawing a square and another a circle should still work as
>>> expected. At the API level all operations can be assumed to be atomic.
>> Oops, I misread what you wrote before and was thinking about drawing
>> to one canvas via different contexts.
_______________________________________________
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