RE: [Rubydotnet-developer] rubydotnet - first announcement
Status: Alpha
Brought to you by:
thomas
From: Ben S. <bsc...@pr...> - 2003-09-04 13:17:30
|
Adding to what John wrote ... > > Have you made any progress on the thread safety issue with=20 > callbacks from > > .net to ruby? I'm wondering if it is necessary to make some kind of > > synchronized queue, where you post you callbacks and then=20 > have a pool of > > ruby threads reading the jobs from that queue as they are=20 > posted. Or maybe > > we could lobby match to add some locking to ruby to make it=20 > thread-safe? I > > know too little about this :-)=20 >=20 > Yep! You are right! Our socket edition of the bridge=20 > handles this correctly > and utilizes a message queue concept. We call the concept=20 > the Post Office in > our classes in the code. Callbacks are handled and posted on=20 > the correct thread > in Ruby and/or .NET. As an aside, we have yet to make our=20 > C++ extension follow > this same behavior. If you're interested, the tests in "Ruby/tests/TestRubySideQueueing.rb" = from our download test the Ruby PostOffice. Threads send socket = messages and then call PostOffice#waitForResult; a receiving thread then = calls #returnResult, #throwException, or #runOnThreadWithId to tell the = waiting thread what to do next. There are similar tests on the .NET side at = "Tests/PostOfficeTesting.cs". The code has some cosmetic differences = between the two sides - which might be nice to iron out - but is = similar. (Our latest release can be found at = "http://www.saltypickle.com/rubydotnet/Downloads".) I'm not sure whether the tests are in great shape for reading - but I'd = be happy to answer any questions! Regards, Ben |