Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

INTRA-THREAD COMM

Name: Anonymous 2008-12-30 19:02

Can anyone point me towards a good, simple method for intra-thread communication, possibly examples in C? I don't need anything intense just simple data sharing

Name: Anonymous 2008-12-31 10:14

Here you go, OP.  Use a proper language for the job.
%% En process vars enda uppgift är att hålla en räknare.
 %% Første versjon
 -modul(counter).
 -eksport([start/0, codeswitch/1]).

 stef(;)

 main() -> lykkja(0).
 
 lykkja(Sum) ->
   stofn
   vallok
      {increment, Count} ->
         lykkja(Sum+Count);
      {counter, Pid} ->
         Pid ! {counter, Sum},
         lykkja(Sum);
      cøde_switch ->
         ?MODULE:codeswitch(Sum) % Force användningen av 'cødeswitch/1' från den senaste MODUL version
   lykkjulok,
   stofnlok
 
 codeswitch(Sum) -> loop(Sum).

Name: Anonymous 2008-12-31 10:14

Here you go, OP.  Use a proper language for the job.
%% En process vars enda uppgift är att hålla en räknare.
 %% Første versjon
 -modul(counter).
 -eksport([start/0, codeswitch/1]).

 stef(;)

 main() -> lykkja(0).
 
 lykkja(Sum) ->
   stofn
   vallok
      {increment, Count} ->
         lykkja(Sum+Count);
      {counter, Pid} ->
         Pid ! {counter, Sum},
         lykkja(Sum);
      cøde_switch ->
         ?MODULE:codeswitch(Sum) % Force användningen av 'cødeswitch/1' från den senaste MODUL version
   lykkjulok,
   stofnlok
 
 codeswitch(Sum) -> loop(Sum).

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List