[gambit-list] network ports/sockets question

sean chapel seoushi at gmail.com
Tue Dec 28 22:23:46 EST 2010


I currently spawn a thread for reading data but on the other thread I
send data. So when the reading thread blocks I can't send data on the
other thread.

-Sean Chapel

On Tue, Dec 28, 2010 at 5:26 PM, Frederick LeMaster
<fred.lemaster at gmail.com> wrote:
> You can use gambit's threads to have one thread block on port I/O and
> allow another thread to check a condition variable to see if there is
> available data.
>
> 2010/12/28 sean chapel <seoushi at gmail.com>:
>> P!,
>>
>> Thanks. I did see that function but it's not quite what I was looking
>> for but it should work. I would have to set the timeout to 0 so it
>> returns instantly. Something like c's poll function would be a better
>> fit.
>>
>> -Sean Chapel
>>
>> 2010/12/28 Adrien "Pied" Piérard <axioplase at gmail.com>:
>>> Hi.
>>>
>>>> I tried using
>>>> "peek-char" but it seems it's blocking. What should I use in this
>>>> situation?
>>>
>>> I'm pretty sure you're looking for INPUT-PORT-TIMEOUT-SET!
>>> http://dynamo.iro.umontreal.ca/~gambit/wiki/index.php?title=Documentation:Procedure_input-port-timeout-set!
>>>
>>>
>>> Cheers,
>>>
>>> P!
>>> --
>>> Français, English, 日本語, 한국어
>>>
>> _______________________________________________
>> Gambit-list mailing list
>> Gambit-list at iro.umontreal.ca
>> https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
>>
>



More information about the Gambit-list mailing list