I'm thinking of extending the capabilities of schannels.

At the moment schannels support two operations: read and write.

An schannel is just a list of fibes, all of which are either
readers or writers waiting for another fibre to do a matching
write or read (resp).

If there are (say) miltiple writers when a reader comes
a long one writer (which one is unspecified) is popped off
the list of waiting writers.

Currently, if you do an unbalanced I/O operation,
your fibre is suspended until a matching operation
comes along.

It is not possible to check before hand.
Although you can implement a "grab the next data
on any one of an array of channels" this only works
easily for the same data type and it only allows
you to lock up at one point in your code waiting.

So I propose to add new method to schannels.

ready_to_read: schannel -> bool
read_to_write: schannel->bool
number_of_pending_readers: schannel -> int
number_of_pending_writers:schannel->int

These operations cannot scale directly to pchannels.
(because they can become invalid just after they return).
For them we would need more like:

        read : pchannel -> opt[T]

which is an "asynchronous" operation. Hmm .. maybe
thats the way to do schannels too.

--
john skaller
skal...@users.sourceforge.net
http://felix-lang.org




------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to