On 8 March 2014 09:37, Johannes Pfau <nos...@example.com> wrote:
> Am Sat, 08 Mar 2014 09:12:48 +0000
> schrieb "Mike" <n...@none.com>:
>
>> On Saturday, 8 March 2014 at 08:09:29 UTC, Timo Sintonen wrote:
>> >
>> > Why do you need synchronized? Are you building some kind of
>> > multithreading library?
>>
>> I don't need it yet.  I'm just exploring features of D and trying
>> to learn how to implement them.  The real problem isn't that I
>> can't use synchronized, but rather that the compiler is not aware
>> of my target.  I haven't searched through GDC's source code yet,
>> but I suspect there will be more problems in the near future if
>> the compiler is not taught about this target.
>>
>> Mike
>>
>
> critsecsize looks like a perfect example for configuration parameters
> which should be provided by the runtime.
>
> I'm thinking of a core/config.d module which can be read by the
> compiler to get information about the runtime:
> ------------
> enum critsecsize = 4;
> enum hasGC = true;
> enum hasAArray = true;
> enum hasUnicodeLoops = true;
> enum hasExceptions = true;
> enum ...
> ------------
>
> I wouldn't be too worried about 'isLinux' in general. Iain moved many
> of these checks out of the frontend IIRC and rewrote them as checks
> using Target::. In the end isLinux is just not the correct check if you
> want to know the critsecsize/used ABI/...
>

The first step was to get the front-end shared among gdc and dmd.

The next step is to fix the codegen so that it does not rely on the
compiler knowing the critsecsize.

Reply via email to