[Mono-list] Mono: TLS. normal versus __thread

Michael Rasmussen mir@miras.org
Thu, 24 Mar 2005 15:16:12 +0100

Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

tor, 24 03 2005 kl. 07:28 -0500, skrev Jonathan Pryor:

> Don't call Syscall.fork unless you really know what you're doing...
> (Someone correct me if the following is wrong...)
> The problem is that Mono is implemented in terms of the Win32 API.  This
> allows portability between Windows and Unix (io-layer implements a Win32
> subset for Unix platforms).  But in order to be efficient at some tasks,
> some data must be shared between all mono tasks.  This data is in the
> ~/.wapi directory.
Well in my case the hole point is to be able to start an application and
the be able to fork it to the background running as a daemon. I find it
hard to see this as a dangerous task?

The problem occurs when mono is compiled with the option TLS normal.
When mono is compiled with the option TLS __thread it works as expected.

> PS: lupus: Is there any scenario where it's actually *safe* to call
> fork?  I'm wondering if I should remove fork(2) and exec(2) from
> Mono.Unix.Syscall...  Alternatively, is there someway to protected
> ~/.wapi so that fork(2) can be safely called?

Forking as process to run as daemon should in my opinion be a safe task.

Michael Rasmussen

Get my public GnuPG keys:
michael  rasmussen  cc
mir  datanom  net
mir  miras  org
I'll burn my books.
-- Christopher Marlowe

Content-Type: application/pgp-signature; name=signature.asc
Content-Description: Dette er en digitalt underskrevet brevdel

Version: GnuPG v1.4.0 (GNU/Linux)