Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Simultaneously reading from a file and serving data

by kennethk (Monsignor)
on Feb 27, 2014 at 19:11 UTC ( #1076435=note: print w/ replies, xml ) Need Help??


in reply to Simultaneously reading from a file and serving data

Couple of thoughts:

  • Split the tasks between two processes, and rather than sharing memory, use a shared database. You could even just have a shared file that contains your JSON and flock on updates.
  • Use threads and share the associated datastore (e.g. HoH) between the two using threads::shared
  • Use alarm to implement a timeout on your socket read.

Any of these sound promising?


#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.


Comment on Re: Simultaneously reading from a file and serving data

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1076435]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2014-10-22 22:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (122 votes), past polls