Hi I just joined this list, and being new to factor, I don't want to comment on factor specific details, but I want to point out that a general problem in this situation is coordinating reads and writes of a common data structure.
Typically you'd want the data structure to have a consistent state when any read or write occurs, so you would need a way to coordinate both the c and factor calls, assuming the calls could be run in parallel. If that's what you'd want then take a look a rich hickey's ideas on state and identity (clojure related stuff) for good thoughts on this. If the calls all not parallel, then you wouldn't have a problem, I think, but from the way you've described what you want to do, it wasn't clear. Hope this helps. To those who factor better, does the language have built in mechanisms for coordinating shared state like clojure ? Cheers Marmaduke On Sep 14, 2011 10:01 PM, "Patrick Mc(avery" <[email protected]> wrote: From the docs and John Benidiktsson's blog: http://re-factor.blogspot.com "fun with wav" I have learn quite a bit about the FFI. However if someone could guide me, I just want to make sure I have a sensible design pattern for it. My application is control of scientific instruments. The I/O functions are short lived but each call is important, I don't want to miss data points. I was thinking that if factor could write to a C struct then a hardware control daemon in C could run I/O functions in a loop that would take arguments from the struct and factor would only guide the daemon from the struct. Does this sound sensible? Is there anything that might cause factor to block the C functions if it was only accessing the struct? Thanks for reading-Patrick ------------------------------------------------------------------------------ BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA Learn about the latest advances in developing for the BlackBerry® mobile platform with sessions, labs & more. See new tools and technologies. Register for BlackBerry® DevCon today! http://p.sf.net/sfu/rim-devcon-copy1 _______________________________________________ Factor-talk mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/factor-talk
------------------------------------------------------------------------------ BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA Learn about the latest advances in developing for the BlackBerry® mobile platform with sessions, labs & more. See new tools and technologies. Register for BlackBerry® DevCon today! http://p.sf.net/sfu/rim-devcon-copy1
_______________________________________________ Factor-talk mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/factor-talk
