[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: scratch/igc fe90d556834: Make glyphs ambiguous roots
From: |
Helmut Eller |
Subject: |
Re: scratch/igc fe90d556834: Make glyphs ambiguous roots |
Date: |
Mon, 29 Jul 2024 11:21:03 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
On Mon, Jul 29 2024, Gerd Möllmann wrote:
>> While fix_frame runs, all other threads are suspended.
>
> I don't think that is guranteed. but please check.
>
> Frames are not roots, so fix_frame can only assume exclusive access to
> the frame struct itself. Other threads can work on glyph_rows, glyphs
> and so on while fix_frame runs.
The doc
https://memory-pool-system.readthedocs.io/en/latest/topic/format.html#cautions
says:
1. The MPS guarantees that format methods have exclusive access to the
object for the duration of the call. This guarantee may entail
suspending arbitrary threads. The methods that manipulate the object
must not perform any sort of inter-thread locking or communication.
...
6. Subject to the above constraints, format methods can freely access:
a. memory inside the object or block that they have been asked to
look at;
b. MPS-managed memory in pools that do not protect their contents;
c. memory not managed by the MPS.
While the doc doesn't guarantee that all other (registered) threads are
suspended, it's hard to imagine what else MPS could do to stop other
threads from messing up the object. (MPS must remove hardware barriers,
so that's not an option.)
>> So why don't we have exclusive access? And why is it not a problem for
>> FRAME_FONT, FRAME_DISPLAY_INFO, etc?
>
> FRAME_X_DISPLAY_INFO has the same problem. It's just that I had the
> glyphs on my todo list. With frame->font I don't see a problem. Fonts
> are pvecs so we only have to fix the pointer to it, and fix_font should
> do the rest.
There is no frame->font. Only a frame->output_data.ns->font. And
ns_output is not part of the frame struct.
> BTW, unrelated. Do you observe problems in clear_face_cache?
Nothing that I'm aware off.