Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ MT-multithreading and servers » Threading example for U++
icon5.gif  Re: Threading example for U++ [message #10989 is a reply to message #10199] Fri, 10 August 2007 08:46 Go to previous messageGo to next message
bonami is currently offline  bonami
Messages: 186
Registered: June 2007
Location: Beijing
Experienced Member
i seriously need some advice how to implement my project.
a UDP client. interface is a thread i suppose. & i'd like my client to run in a thread. thus, i donno how to communicate b/t them. in my thread, i need to watch both the network socket and something between UI. if linux, i can select(), but in U++, what? i plan to use a std::queue which UI writes and my thread reads and this still seems not so fit into U++.
any suggestions? thank you very much
Re: Threading example for U++ [message #11066 is a reply to message #10989] Fri, 17 August 2007 19:45 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
bonami wrote on Fri, 10 August 2007 02:46

i seriously need some advice how to implement my project.
a UDP client. interface is a thread i suppose. & i'd like my client to run in a thread. thus, i donno how to communicate b/t them. in my thread, i need to watch both the network socket and something between UI. if linux, i can select(), but in U++, what? i plan to use a std::queue which UI writes and my thread reads and this still seems not so fit into U++.
any suggestions? thank you very much


Why do not you just use "select" ? Smile

Mirek
Re: Threading example for U++ [message #11320 is a reply to message #11066] Tue, 04 September 2007 09:05 Go to previous message
bonami is currently offline  bonami
Messages: 186
Registered: June 2007
Location: Beijing
Experienced Member
i prefer Win32 programming. so i suppose WaitForSingleObject or sth. should be what I need. since i never win32 programmed before, i have trouble here. if i both WSAStartup and select(), i suppose it is a mix of styles and thus puzzling.

Anyway, as a last resort, select() is acceptable for me, too. however in this case, i don't know how to inter-thread communicate using select() since i need to communicate using SOCKET

[Updated on: Tue, 04 September 2007 09:25]

Report message to a moderator

Previous Topic: Non-Blocking socket example
Next Topic: typo in manual on web
Goto Forum:
  


Current Time: Fri Mar 29 09:04:38 CET 2024

Total time taken to generate the page: 0.01981 seconds