Skip to content
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

multi-threaded tabfs.c #29

Merged
merged 2 commits into from Jan 4, 2021
Merged

multi-threaded tabfs.c #29

merged 2 commits into from Jan 4, 2021

Conversation

huglovefan
Copy link
Contributor

@huglovefan huglovefan commented Jan 3, 2021

plz test

it's the same as before but it can interleave requests now

closes: #7
closes: #14
closes: #18
closes: #27

@gavinlaking
Copy link

Can confirm that it closes #27 by removing the usage output altogether.

@bjesus
Copy link

bjesus commented Jan 3, 2021

Also confirming it fixes #7, #18 and #14 here. Awesome work!

@osnr
Copy link
Owner

osnr commented Jan 3, 2021

wow, brilliant work! I'll look at this & hopefully merge it today.

@osnr
Copy link
Owner

osnr commented Jan 4, 2021

Still looking at this, but I wanted to post an update:

Are the folks who have it working all on Linux? On my Mac, I had to remove -oauto_unmount -- although maybe newer macFUSE supports it and I just need to update? -- and now have an error at runtime:

* thread #3, stop reason = EXC_BAD_ACCESS (code=2, address=0x70000155cff8)
  * frame #0: 0x00007fff68477bc7 libsystem_pthread.dylib`___chkstk_darwin + 55
    frame #1: 0x0000000100007bee tabfs
    frame #2: 0x00000001000068d2 tabfs`tabfs_getattr(path=<unavailable>, stbuf=0x00007000015dcdd0) at tabfs.c:209:5 [opt]

plus a bunch of instances of this warning on compile

tabfs.c:209:5: warning: incompatible pointer to integer conversion initializing 'unsigned int' with an expression of type
      'pthread_t _Nonnull' (aka 'struct _opaque_pthread_t *') [-Wint-conversion]
    exchange_json(&rdata, &rsize,
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tabfs.c:178:22: note: expanded from macro 'exchange_json'
        unsigned int id = pthread_self(); \
                     ^    ~~~~~~~~~~~~~~

@bjesus
Copy link

bjesus commented Jan 4, 2021

Confirming that I only tested it with FF Developer and Arch Linux.

@huglovefan
Copy link
Contributor Author

@osnr: can you try it now with commit 57331e2?

i might've fixed the EXC_BAD_ACCESS if it was a stack overflow like i suspect (converted the 1MB stack array to a heap-allocated one)

I had to remove -oauto_unmount -- although maybe newer macFUSE supports it and I just need to update?

i'm on linux so don't know, need a macfuse user to confirm this

@osnr osnr merged commit 6e829c1 into osnr:master Jan 4, 2021
@osnr
Copy link
Owner

osnr commented Jan 4, 2021

Works great now. This is really excellent stuff, and you've solved a lot of problems I was dreading having to think through. I'm also glad the design was clear enough that you were able to figure it all out. Thanks again! 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants