[Mono-dev] TCP (threadpool.c)
Rodrigo Kumpera
kumpera at gmail.com
Tue Apr 23 11:25:37 UTC 2013
Use a recent version of mono on OSX because DISABLE_AIO has no effect on
OSX since the kqueue backend has been disabled.
On Tue, Apr 23, 2013 at 3:46 AM, Roope Kangas <roope at grandcrugames.com>wrote:
> Hi,
>
> On OSX I keep getting "shutting down finalizer thread timed out" or just
> process hang ups on exit if I do not use MONO_DISABLE_AIO.
>
> And only if I try to use async send so I don't think this is linux only...
>
> --
> Roope Kangas / LSD, Grand Cru
> +358 40 869 6976 roope at grandcrugames.com
> http://grandcrugames.com/ @grandcrugames
>
> On Tuesday, April 23, 2013 at 10:43 AM, Greg Young wrote:
>
> Should this be the new default build for linux then?
>
> On Tue, Apr 23, 2013 at 4:23 AM, Rodrigo Kumpera <kumpera at gmail.com>
> wrote:
>
> The problem is specific to the epoll backed, if you disable it[1] your
> problem is fixed.
> I could repro it on linux-amd64 with epoll enabled but could not with it
> disabled.
>
> The way to fix this is:
>
> -move locking to the epoll backend and make sure it works there;
> -use a pipe like other backends to wake up the waiter and do all epoll ops
> from a single thread
>
>
> [1] Set the MONO_DISABLE_AIO env var
>
> We still have this patch that we use with mono.
>
> diff --git a/mono/metadata/threadpool.c b/mono/metadata/threadpool.c
> index e8a2f1a..f83e473 100644
> --- a/mono/metadata/threadpool.c
> +++ b/mono/metadata/threadpool.c
> @@ -555,8 +555,8 @@ socket_io_add (MonoAsyncResult *ares,
> MonoSocketAsyncResult *state)
>
> mono_g_hash_table_replace (data->sock_to_state, state->handle, list);
> ievt = get_events_from_list (list);
> - LeaveCriticalSection (&data->io_lock);
> data->modify (data->event_data, fd, state->operation, ievt, is_new);
> + LeaveCriticalSection (&data->io_lock);
> }
>
>
> We tried to submit this previously as it resolves our problems. It was
> rejected that it introduces a deadlock. We have provided tests that
> show without this change that TCP is basically unusable calls like
> beginsend sometimes never call endsend.
>
> I would really prefer to not be distributing a "custom" version of
> mono with this patch so how can we resolve this.
>
> Cheers,
>
> Greg
>
> --
> Le doute n'est pas une condition agréable, mais la certitude est absurde.
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
>
>
>
> --
> Le doute n'est pas une condition agréable, mais la certitude est absurde.
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20130423/5fccc58c/attachment.html>
More information about the Mono-devel-list
mailing list