Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Simultaneously reading from a file and serving data

by kennethk (Abbot)
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?
[LanX]: you will Theodi-see!
[Eily]: congrats choroba :)
[Discipulus]: choroba i made you Bishop !!
[choroba]: 9999 points until level 23 - Archbishop.
[LanX]: darn trying to downvote him again fails ... ;-P
[Discipulus]: congrats!
[LanX]: His Excelleny Choroba will now nbe clothed in his new robe ...
[Discipulus]: bishop ship sheeps in the shop..
[1nickt]: Discipulus too easy!

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (10)
As of 2017-09-26 11:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (294 votes). Check out past polls.

    Notices?