diff options
author | neodarz <neodarz@neodarz.net> | 2018-08-11 20:21:34 +0200 |
---|---|---|
committer | neodarz <neodarz@neodarz.net> | 2018-08-11 20:21:34 +0200 |
commit | 0ea5fc66924303d1bf73ba283a383e2aadee02f2 (patch) | |
tree | 2568e71a7ccc44ec23b8bb3f0ff97fb6bf2ed709 /pipermail/nel/2001-February/000291.html | |
download | nevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.tar.xz nevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.zip |
Initial commit
Diffstat (limited to '')
-rw-r--r-- | pipermail/nel/2001-February/000291.html | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/pipermail/nel/2001-February/000291.html b/pipermail/nel/2001-February/000291.html new file mode 100644 index 00000000..0a6ba1f5 --- /dev/null +++ b/pipermail/nel/2001-February/000291.html @@ -0,0 +1,116 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> +<HTML> + <HEAD> + <TITLE> [Nel] NeL Network Engine</TITLE> + <LINK REL="Index" HREF="index.html" > + <LINK REL="made" HREF="mailto:cblt%40cblt.org"> + <LINK REL="Previous" HREF="000289.html"> + <LINK REL="Next" HREF="000294.html"> + </HEAD> + <BODY BGCOLOR="#ffffff"> + <H1>[Nel] NeL Network Engine</H1> + <B>Nicolas Hognon</B> + <A HREF="mailto:cblt%40cblt.org" + TITLE="[Nel] NeL Network Engine">cblt@cblt.org</A><BR> + <I>Wed, 28 Feb 2001 10:57:11 +0100</I> + <P><UL> + <LI> Previous message: <A HREF="000289.html">[Nel] NeL Network Engine</A></li> + <LI> Next message: <A HREF="000294.html">[Nel] NeL Network Engine</A></li> + <LI> <B>Messages sorted by:</B> + <a href="date.html#291">[ date ]</a> + <a href="thread.html#291">[ thread ]</a> + <a href="subject.html#291">[ subject ]</a> + <a href="author.html#291">[ author ]</a> + </LI> + </UL> + <HR> +<!--beginarticle--> +<PRE> +><i> In this case, we have to forget the solution where each +</I>><i> socket is on a thread and use a blocked receive(). The problem is that +</I>><i> select() is quite slow and if we have only 100 thread, +</I>><i> each thread needs to manage, with a select(), around 50 players and we ll +</I>><i> lost lot of time to create the array for the select() +</I>><i> and check who have wakeup the select(). +</I> +I encouter the same problem : one thread must manage more than one +socket on the server. the problem is how managing those socket +in the thread. the problem is I want to be portable between windows +and linux :(( + +under windows there is many solution : + - select (the only one which is portable) + - windows event and message + - overlapped I/O + +under linux the only solution I know is : + - select / poll : i'm not sure but i think the difference between + select and poll is that with poll you don't have to fill your array + before each call. + +another problem when a thread maange more than one socket is +what your threads will do : + +a first approch is something like that : + +while(run) +{ + TestSokets(); + + for each socket which received something + do + read the incoming data + process the data + send data + done +} + +but during one step of this loop your socket list must be locked +so if a new socket need to enter this thread the calling thread will be +blocked. + +a solution is to have more than one thread type. +thread which test and read socket (perhaps wire in socket to) +thread which to process a network message queue. +(and perhaps thread which send network message) + +but it increase the number of thread so the maximum +number of client is lesser. + +but i'm not really used to programming with thread yet so perhaps +my problem are not really problems. + +i hope this can help and you can understand me :)) +and i think i'll take a look at <A HREF="http://oss.sgi.com/projects/state-threads/">http://oss.sgi.com/projects/state-threads/</A> +to ... + +good luck + + +-- +Nicolas Hognon +<A HREF="mailto:nicolash@virtools.com">nicolash@virtools.com</A> + +Virtools - The Behavior Company +Tel. (+33) 1 42 71 46 86 / Fax. (+33) 1 42 71 86 53 +<A HREF="http://www.virtools.com/">http://www.virtools.com/</A> + + +</pre> + + + +<!--endarticle--> + <HR> + <P><UL> + <!--threads--> + <LI> Previous message: <A HREF="000289.html">[Nel] NeL Network Engine</A></li> + <LI> Next message: <A HREF="000294.html">[Nel] NeL Network Engine</A></li> + <LI> <B>Messages sorted by:</B> + <a href="date.html#291">[ date ]</a> + <a href="thread.html#291">[ thread ]</a> + <a href="subject.html#291">[ subject ]</a> + <a href="author.html#291">[ author ]</a> + </LI> + </UL> +</body></html> |