This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: why the strange stack stuf in cygwin?


On Mon, Sep 01, 2008 at 08:33:16AM +0000, Jay wrote:
> Why does Cygwin do such wierd stuff with the top of the stack?
> Is this to have thread locals faster than TlsGetValue offers?

No, it is a work-around for this:

  % cat <<'EOF' > foo.c
  __thread int abc;

  int
  main (int argc, char **argv)
  {
    printf ("%d\n", abc);
  }
  EOF

  % gcc -o foo foo.c
  foo.c:2: error: thread-local storage not supported for this target

> Is it worth it?

What kind of answer do you expect here?  A head slap and a "What were we
thinking???"

> (The cost: harder to LoadLibrary(cygwin1.dll),

Dynamic linking of cygwin1.dll (i.e., making it easier to be a 3PP) has never
been a core goal of Cygwin.

>harder to port to other architectures,

Cygwin works on all of the architectures that Windows NT+ supports.
Porting Cygwin to architectures supported by Windows CE would require
quite a bit more work than fiddling with the thread local storage model.

>the strange path where DllMain "respawns", etc.)

"the strange path"?

You're using shorthand which assumes that people understand your thought
processes and conclusions.  If you have a point to make you really need
to provide more details and concrete examples of an alternate method for
doing what is currently accomplished by Cygwin's tls method.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]