- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
As stated in this post on TheBuildingCoder, Revit cannot make API calls from multiple threads within the same process:
https://thebuildingcoder.typepad.com/blog/2014/11/the-revit-api-is-never-ever-thread-safe.html
At the end of the blog post, Jeremy mentions that using multiple processes is possible.
I just want to ask any experienced coders: Do you know of any reason why this can't be done? Are there any complications such as a need to use external events?
I am making API calls from IronPython and want to do some form of parallel processing. First I tried python's multiprocessing module, but IronPython doesn't have that. Then I tried parallel LINQ queries via .NET, but it turns out that uses multithreading, which is not allowed. Right now, I am using python's Subprocess module to spawn multiple processes that operate in parallel. This works within IronPython, but I have only done trivial tasks so far. I have not attempted to make multiple API calls from each process yet and I am wondering if this is possible.
I have searched the forum and have not seen a definitive answer to this, just rumors that it may be possible. Before I try it, it would be nice if someone already knows the answer. If I try it for myself, it will be hard for me to know if it is truly impossible, or if I have just made some tangential error, so please clue me in if you know the answer.
@jeremytammik, I will go ahead and mention you since you are the one who is likely to know. Thanks in advance!
Solved! Go to Solution.