ctietze,
@ctietze@mastodon.social avatar

fam and lazyweb enthusiasts,

to kickstart a research project, do you have a link handy to limit Swift code to execute on a particular thread (!) that works on macOS 11+?

helge,
@helge@mastodon.social avatar

@ctietze As discussed elsewhere 🙈 Thread + RunLoop is one thing you can do.

ctietze,
@ctietze@mastodon.social avatar

@helge I guess that was discarded by someone else already then :D

mattiem,
@mattiem@mastodon.social avatar

@ctietze with concurrency?

ctietze,
@ctietze@mastodon.social avatar

@mattiem with whatever it takes :)

mattiem,
@mattiem@mastodon.social avatar

@ctietze with concurrency requires custom executors, which is new and I’m not sure what the availability is.

Without concurrency, though, shouldn’t be any different that ObjC. Is it?

ctietze,
@ctietze@mastodon.social avatar

@mattiem Yeah, I never worked with NSRunLoop + NSThread isolation in the past, but this old Realm article looks ok: https://academy.realm.io/posts/realm-notifications-on-background-threads-with-swift/

mattiem,
@mattiem@mastodon.social avatar

@ctietze I would be very interested if you opted to go for the custom executor path, and I'd even offer to help a bit! But, I bet avoiding it is more practical.

icanzilb,
@icanzilb@mastodon.social avatar

@mattiem @ctietze lol I wouldn't trust that guy who wrote the article, what does he know 😂

icanzilb,
@icanzilb@mastodon.social avatar

@mattiem @ctietze apropos if you're copying this code I remember there might've been an issue picking between distant future or past for the runloop run, but can't remember details right now

ctietze,
@ctietze@mastodon.social avatar

@icanzilb @mattiem :blobcatcoffee: thanks

ctietze, (edited )
@ctietze@mastodon.social avatar

@mattiem Thank you for the offer! Favored solution 100%, but it's maybe not backdeployed, maybe it is, so not sure if we can wait for Xcode 15 RC 🤷‍♂️ @oliep

helge,
@helge@mastodon.social avatar

@mattiem @ctietze People say the executors require macOS 14+. But yes, otherwise same situation as in ObjC.

icanzilb,
@icanzilb@mastodon.social avatar

@helge @mattiem @ctietze executors were available from start, just that you were not able to create new ones so maybe they backported the new parts? I'm also curious but have no time to check 😬

ctietze,
@ctietze@mastodon.social avatar

@icanzilb @helge @mattiem https://github.com/apple/swift/blob/0f201443acf3b12975b63a49611dea8131c007df/stdlib/public/BackDeployConcurrency/Actor.cpp

I don't know exactly what I'm seeing, but it kinda sorta looks like it's not tied to macOS 14, maybe?

  • All
  • Subscribed
  • Moderated
  • Favorites
  • swift
  • kavyap
  • GTA5RPClips
  • Durango
  • ethstaker
  • ngwrru68w68
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • everett
  • Youngstown
  • mdbf
  • slotface
  • rosin
  • tacticalgear
  • JUstTest
  • cubers
  • normalnudes
  • anitta
  • tester
  • khanakhh
  • osvaldo12
  • InstantRegret
  • modclub
  • provamag3
  • Leos
  • cisconetworking
  • megavids
  • lostlight
  • All magazines