|
Careful Drums posted:so i need to make a dead simple api. it has only one endpoint, and the result is going to be a json object with a name and a date and a time. it will accomplish this by querying some database table full of datetimes and names and returning the next closest one in the future. if its honestly that simple who cares just pick the language you know and host it in my butt (the cloud). you can host .NET shits on not-azure.
|
![]() |
|
![]()
|
# ? Jun 11, 2024 14:06 |
|
GrumpyDoctor posted:when did "api" start meaning "rest api" Well "rest api" now means "api that returns JSON over HTTP"
|
![]() |
|
fleshweasel posted:if its honestly that simple who cares just pick the language you know and host it in my butt (my butt). you can host .NET shits on not-azure. you could, but why would you? azure is so staggeringly trivial
|
![]() |
|
MononcQc posted:Well "rest api" now means "api that returns JSON over HTTP" same
|
![]() |
|
Subjunctive posted:writing lock-free code is for people who think doing exception safety in C++ was for casuals and make strict-aliasing jokes at dinner parties. go channels
|
![]() |
|
Series DD Funding posted:go channels are they lock-free? I thought they were just a traditional message queue. neat.
|
![]() |
|
Subjunctive posted:are they lock-free? I thought they were just a traditional message queue. neat. the whole point of go is concurrency so i dont know why you would think that
|
![]() |
|
necrotic posted:the whole point of go is concurrency so i dont know why you would think that lock free does not mean "you don't have to use mutexes directly in your code", it means a malicious thread scheduler can't stop the progress of your code
|
![]() |
|
necrotic posted:the whole point of go is concurrency so i dont know why you would think that because you can have lots of concurrency without lock-free structures? why couldn't go's channels have a lock protecting the queue, with the channel flows racing freely other than manipulation of the queue itself? is there a semantic element to the channel model that requires lock-free implementation? e: in fact, if I'm following this golang-dev thread correctly, they abandoned the lock-free implementation of channels because the complexity didn't pay for itself; that certainly matches my experience! Subjunctive fucked around with this message at 11:34 on Nov 29, 2014 |
![]() |
|
b0lt posted:lock free does not mean "you don't have to use mutexes directly in your code", it means a malicious thread scheduler can't stop the progress of your code If the thread scheduler is malicious isn't your OS completely hosed and compromised anyway
|
![]() |
|
I think that may be an obtuse way of saying that there is no time that the thread scheduler can halt one thread in order to cause all other threads to also halt
|
![]() |
|
And that's just an obtuse way of saying there are no critical sections
|
![]() |
|
that is, no global locks? or am I confused
|
![]() |
|
Or local locks. You know, lock free.
|
![]() |
|
pseudorandom name posted:Or local locks. Ayy
|
![]() |
|
Oh, I get what you're asking -- when I said "all other threads" I meant all other threads participating in your lock free algorithm, not all threads in general
|
![]() |
|
pseudorandom name posted:Oh, I get what you're asking -- when I said "all other threads" I meant all other threads participating in your lock free algorithm, not all threads in general I think I get it; though this is not my area of expertise at all
|
![]() |
|
MononcQc posted:Well "rest api" now means "api that returns JSON over HTTP"
|
![]() |
|
MononcQc posted:Well "rest api" now means "api that returns JSON over HTTP" Same as agile means "ad-hoc planning of no particular structure"
|
![]() |
|
necrotic posted:the whole point of go is concurrency so i dont know why you would think that locks are hard to get right, amusingly enough lock free code is even harder to write than locks edit: https://view.officeapps.live.com/op/view.aspx?src=http://twvideo01.ubm-us.net/o1/vault/gdc09/slides/GDC09_Dawson_Lockless_Programming.ppt this is ![]()
|
![]() |
|
I don't get how lock-free message queues could really help. If your thread's doing nothing, it's going to be waiting for a wake-up so you've got to do a system call anyway. If you're under load, the thread's doing a lot of stuff so you're probably not going to contend anyway (because you'd send messages in batches). And I think you'd use a spin-lock just under the principle of things. Or is the idea of lock-free message queues that there's less latency under load (when sending messages across different threads, of course) because you're pushing messages to the other thread immediately instead of queuing them locally and sending them in a batch?
|
![]() |
|
sarehu posted:I don't get how lock-free message queues could really help. If your thread's doing nothing, it's going to be waiting for a wake-up so you've got to do a system call anyway. If you're under load, the thread's doing a lot of stuff so you're probably not going to contend anyway (because you'd send messages in batches). And I think you'd use a spin-lock just under the principle of things. That sums up LMAX Disruptor pattern. The "common problem" of too many cores to use, so lets have some spinning waiting for a message. I actually heard my boss suggest adding a verb to a REST interface so that "different things could be requested". Using directories or just the name of the item was too obvious apparently.
|
![]() |
|
The simplest way to solve such a problem is to use a consensus algorithm such as Paxos or Raft, and this was the direction I was going to take. However implementing consensus algorithms is hard. Actually it is so hard that often years are needed for implementations to stabilize. At some point I noticed something that makes the work of Redis Cluster nodes simpler, that is, information about hash slots is always idempotent. If hash slot 5 is served by A, and later because the configuration changes hash slot 5 is served by B, nodes don't need to know what happened, everything they need is that the configuration for an hash slot was updated. This changes everything basically: agreement protocols are able to take a state machine synchronized by running the same sequence of operations in every node. If the state machine is deterministic, then the internal state will be the same in all the nodes eventually. However all the state Redis Cluster needs, for a given slot, can be embedded into a single packet. Because of this we don't need a log of operations stored on disk, nor a way to make sure to fetch all the operations still not fetched, or to figure out what should be applied and what not, all the state can be copied in a single message. In short Redis Cluster does not require a full agreement protocol so I stolen just what I needed from Raft, and tried to figure out the rest.
|
![]() |
|
- the simplest way is to use something that works - but things that work are really hard to implement - and these tested methods take a while to shake out edge cases - so i copied what i could take and improvised the rest because who cares
|
![]() |
|
so redis is a perfectly adequate memcached alternative, and antirez is a better C programmer than i am, but drat he's adorable when he writes about distributed systems and persistence
|
![]() |
|
goddamn it antirez, quorum systems and eventually consistent stuff don't have the same semantics at all ![]()
|
![]() |
|
MrMoo posted:That sums up LMAX Disruptor pattern. The "common problem" of too many cores to use, so lets have some spinning waiting for a message. Oh, so it spins when idle instead of waiting for a pipe or eventfd notification? Or god forbid, a POSIX condition variable? Rad. e: Incidentally back in barebones multi-core memcache persistence days of RethinkDB, sarehu fucked around with this message at 04:16 on Nov 30, 2014 |
![]() |
|
sarehu posted:e: Incidentally back in barebones multi-core memcache persistence days of RethinkDB, this is either a really, really serious kernel bug, or you were using ubuntu
|
![]() |
|
Notorious b.s.d. posted:this is either a really, really serious kernel bug, or you were using ubuntu we used to have the same issue doing JS benchmarking in the browser: the CPU would step down during load of the next phase, and screw up the numbers. similarly, if the GPU stalls out the CPU in the Rift's rendering model, we can see step-down leading to the next frame being missed and things getting nauseating.
|
![]() |
|
wpf folks: i'm doing an app that has to output currency and i want to be able to change textbox formatting based on the currency selected. my thought was to use a converter and somehow bind the combobox value (which is bound to a property in my viewmodel) where the user selects the currency to the window culture and pass that to the converter so i can get the correct currency symbol and put it in the textbox. is this the right way to do it? if so, uh, how do i actually do it?
|
![]() |
|
Blinkz0rz posted:wpf folks: i'm doing an app that has to output currency and i want to be able to change textbox formatting based on the currency selected. Use Haskell.
|
![]() |
|
sarehu posted:Use Haskell. ![]()
|
![]() |
|
my coworkers have started up a lunchtime thing for us to learn us some Golang. im excite
|
![]() |
|
terrible way to waste your lunch time
|
![]() |
|
Notorious b.s.d. posted:this is either a really, really serious kernel bug, or you were using ubuntu It was Ubuntu.
|
![]() |
|
sarehu posted:RethinkDB, [...] congrats
|
![]() |
|
sarehu posted:
sounds like you were having a poo poo time so congrats ![]()
|
![]() |
|
Blinkz0rz posted:wpf folks: i'm doing an app that has to output currency and i want to be able to change textbox formatting based on the currency selected. you could use an IMultiValueConverter to do it that way but this might be a question for the grey thread
|
![]() |
|
Was wondering why people were congratulating shrughes until I realized it wasn't shrughes.
|
![]() |
|
![]()
|
# ? Jun 11, 2024 14:06 |
|
Suspicious Dish posted:Was wondering why people were congratulating shrughes until I realized it wasn't shrughes. http://forums.somethingawful.com/showthread.php?threadid=2773485&pagenumber=392&perpage=40#post426637272 ![]() edit: fwiw i have been through too many terrible jobs which have broken me as a person, and i do not wish this upon other people, even if they're a more-rational-than-thou jerk tef fucked around with this message at 04:42 on Dec 1, 2014 |
![]() |