-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UltraDict dependency 'atomics' is not compatible with MacBook silicon (m1) #17
Comments
Hi @JOEAV, thanks for your issue report. It's a pitty that the atomics library is not available on Mac Arm. Maybe you could try to compile it yourselves? Here is the git repo: https://github.com/doodspav/atomics How are you launching those processes A and B? If you can use the fork method, you would not need the With which parameters are you running UltraDict exactly? There are a few cleanup fixes in the dev branch. It might be worth to try them to see if your problem goes away. In this other issue, I've also explained some ways how to "manually" unlink old UltraDict memory. Please check it out and let me know if that helps: #16 (comment) If all of that does not help, what is the exact error message your are getting? |
@JOEAV Btw, according to https://www.python.org/downloads/release/python-391/ it should be possible to run 'universal2' wheels on Apple Silicon for the atomics library. |
A. this is my constructor : priceUpdates = ultradict({},name='test',buffer_size=1_000_000,auto_unlink=False,recurse=False)
priceUpdate UltraDict is created on main process and then it's memory is being sent to other processes by their ignite function |
but if Process B (consumer) exit by SIGINT the dictionary seems to enter a state which you can't clear it even with unlink() and close(). @JOEAV Hmm, are you sure this observation is correct? If the consumer dies and its never writing to the dict, why would it have any effect on the dict state? What happens if you try to call unlink() or close() in your Process A after your Process B has died? Have you tried the dev branch of UltraDict to see if it helps? There are some improvements if you pass around an UltraDict between processes. I don't know anything about ProcessPoolExecutor but maybe it would help to 'reconnect' to the UltraDict in your child processes, so instead of passing around priceUpdate, in each process you do I also recommend not to set |
Version : branch master
OS: macOS big sur version 11.6
The scenario:
I'm using this module in an algotrading bot app.
One mechanism I'm driving with this is helping the bot get quick updates from other process which is responsible of transmitting price updates.
The dictionary is a smart move as it is the right tool for the job. Process A fill a dictionary with prices . Process B consume those prices and makes math calculations based on them.
My Issue .
As the bot run inside a while loop , it never really exits gracefully but through an interrupt (SIGINT , then SIGTERM)
if the Producer of dict(Process A) exit by SIGINT its fine. but if Process B (consumer) exit by SIGINT the dictionary seems to enter a state which you can't clear it even with unlink() and close(). only restart helps with this scenario (checked /dev/shm but /shm does not exist on my hd)
That lad me to try the shared lock mechanism (because I thought it might help with accessing this map with a lock)
When I run the code again I was given an error stating "atomics" is not found. after a short pip install atomics I found out they don't have a wheel for Mac arm wheel but only universal one. when running again I get the error of "mech-o:wrong architecture"
even if I exclude t "shared lock=true" it keeps throw errors on the same thing. a restart to the computer is the only thing which clears that thing.
I suggest sort this quick as MacBook m1 computers are not that rare and it's actually a quite great library which I'm currently cannot really use :\
The text was updated successfully, but these errors were encountered: