Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Simultaneously reading from a file and serving data

by kennethk (Abbot)
on Feb 27, 2014 at 19:11 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1076435]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (2)
As of 2024-04-19 19:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found