No subject
From: ()
Date: Fri Jul 13 09:02:16 EDT 2012 |
|
from the async behavior of threads).
On Sat, Nov 10, 2012 at 8:55 PM, Kevin Tew <tewk at cs.utah.edu> wrote:
> I'm not sure I understand your question.
> But you need to wrap your input events with handle-evt or wrap-evt so you
> can close over state that helps you distinguish the events when sync
> returns.
>
> Kevin
>
> On 11/10/2012 10:55 AM, Laurent wrote:
>
> Hi,
>
> Can a single 'sync' accept several input-port events?
> From my little tests, it seems not, but this does not seem to match what
> the docs say.
> To make it work and avoid one of the clients to be blocked half of the
> time, I needed to run several sync's in different thread. But then I don't
> see the interest of using 'sync' over a normal 'read'.
>
> Thanks,
> Laurent
>
>
> ____________________
> Racket Users list:
> http://lists.racket-lang.org/users
>
>
>
--047d7b3398596012ec04ce29d4ed
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Yes, that's what I did.<br>The code is here:<br><a href=3D"https://gith=
ub.com/Metaxal/RWind/blob/master/server-sync.rkt">https://github.com/Metaxa=
l/RWind/blob/master/server-sync.rkt</a><br><br>The commented main is the si=
ngle-sync version, which does not work as intended (i.e., clients can get b=
locked when several clients are connected), and the uncommented main is wit=
h threads, which does work.<br>