C (linux) - Emulate / Skip scanf input -


i have program running 2 threads. first waiting user input (using scanf), second listening data on udp socket. emulate user input handle specific notification first thread everytime recive specific udp packet. know can share variables between threads, question is: can force scanf take input different thread? can skip scanf in first thread?

i believe scanf() definition reads stdin. said, though, different threads share memory it's easy pass information between them. maybe have shared variable , sort of boolean value indicating whether or not information has been updated thread reading network. depends on you're trying do, may want have other mechanism simulation bypasses scanf().


Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -